Class: LanguageServer::Protocol::Interface::SemanticTokensRegistrationOptions

Inherits:
Object
  • Object
show all
Defined in:
lib/language_server/protocol/interface/semantic_tokens_registration_options.rb

Overview

Since:

  • 3.16.0

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(document_selector:, legend:, range: nil, full: nil, work_done_progress: nil, id: nil) ⇒ SemanticTokensRegistrationOptions

Returns a new instance of SemanticTokensRegistrationOptions.

Since:

  • 3.16.0



8
9
10
11
12
13
14
15
16
17
18
19
# File 'lib/language_server/protocol/interface/semantic_tokens_registration_options.rb', line 8

def initialize(document_selector:, legend:, range: nil, full: nil, work_done_progress: nil, id: nil)
  @attributes = {}

  @attributes[:documentSelector] = document_selector
  @attributes[:legend] = legend
  @attributes[:range] = range if range
  @attributes[:full] = full if full
  @attributes[:workDoneProgress] = work_done_progress if work_done_progress
  @attributes[:id] = id if id

  @attributes.freeze
end

Instance Attribute Details

#attributesObject (readonly)

Since:

  • 3.16.0



69
70
71
# File 'lib/language_server/protocol/interface/semantic_tokens_registration_options.rb', line 69

def attributes
  @attributes
end

Instance Method Details

#document_selectorDocumentSelector | null

A document selector to identify the scope of the registration. If set to null the document selector provided on the client side will be used.

Returns:

  • (DocumentSelector | null)

Since:

  • 3.16.0



26
27
28
# File 'lib/language_server/protocol/interface/semantic_tokens_registration_options.rb', line 26

def document_selector
  attributes.fetch(:documentSelector)
end

#fullboolean | { delta:boolean } | nil

Server supports providing semantic tokens for a full document.

Returns:

  • (boolean | { delta:boolean } | nil)

Since:

  • 3.16.0



51
52
53
# File 'lib/language_server/protocol/interface/semantic_tokens_registration_options.rb', line 51

def full
  attributes.fetch(:full)
end

#idstring | nil

The id used to register the request. The id can be used to deregister the request again. See also Registration#id.

Returns:

  • (string | nil)

Since:

  • 3.16.0



65
66
67
# File 'lib/language_server/protocol/interface/semantic_tokens_registration_options.rb', line 65

def id
  attributes.fetch(:id)
end

#legendSemanticTokensLegend

The legend used by the server

Returns:

Since:

  • 3.16.0



34
35
36
# File 'lib/language_server/protocol/interface/semantic_tokens_registration_options.rb', line 34

def legend
  attributes.fetch(:legend)
end

#rangeboolean | { } | nil

Server supports providing semantic tokens for a specific range of a document.

Returns:

  • (boolean | { } | nil)

Since:

  • 3.16.0



43
44
45
# File 'lib/language_server/protocol/interface/semantic_tokens_registration_options.rb', line 43

def range
  attributes.fetch(:range)
end

#to_hashObject

Since:

  • 3.16.0



71
72
73
# File 'lib/language_server/protocol/interface/semantic_tokens_registration_options.rb', line 71

def to_hash
  attributes
end

#to_json(*args) ⇒ Object

Since:

  • 3.16.0



75
76
77
# File 'lib/language_server/protocol/interface/semantic_tokens_registration_options.rb', line 75

def to_json(*args)
  to_hash.to_json(*args)
end

#work_done_progressboolean | nil

Returns:

  • (boolean | nil)

Since:

  • 3.16.0



56
57
58
# File 'lib/language_server/protocol/interface/semantic_tokens_registration_options.rb', line 56

def work_done_progress
  attributes.fetch(:workDoneProgress)
end