Class: LanguageServer::Protocol::Interface::SemanticTokensOptions

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(work_done_progress: nil, legend:, range: nil, full: nil) ⇒ SemanticTokensOptions

Returns a new instance of SemanticTokensOptions.



5
6
7
8
9
10
11
12
13
14
# File 'lib/language_server/protocol/interface/semantic_tokens_options.rb', line 5

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

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

  @attributes.freeze
end

Instance Attribute Details

#attributesObject (readonly)

Returns the value of attribute attributes.



46
47
48
# File 'lib/language_server/protocol/interface/semantic_tokens_options.rb', line 46

def attributes
  @attributes
end

Instance Method Details

#fullboolean | { delta?: boolean; }

Server supports providing semantic tokens for a full document.

Returns:

  • (boolean | { delta?: boolean; })


42
43
44
# File 'lib/language_server/protocol/interface/semantic_tokens_options.rb', line 42

def full
  attributes.fetch(:full)
end

#legendSemanticTokensLegend

The legend used by the server



25
26
27
# File 'lib/language_server/protocol/interface/semantic_tokens_options.rb', line 25

def legend
  attributes.fetch(:legend)
end

#rangeboolean | {}

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

Returns:

  • (boolean | {})


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

def range
  attributes.fetch(:range)
end

#to_hashObject



48
49
50
# File 'lib/language_server/protocol/interface/semantic_tokens_options.rb', line 48

def to_hash
  attributes
end

#to_json(*args) ⇒ Object



52
53
54
# File 'lib/language_server/protocol/interface/semantic_tokens_options.rb', line 52

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

#work_done_progressboolean

Returns:

  • (boolean)


17
18
19
# File 'lib/language_server/protocol/interface/semantic_tokens_options.rb', line 17

def work_done_progress
  attributes.fetch(:workDoneProgress)
end