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

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

Overview

Since:

  • 3.16.0

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

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

Returns a new instance of SemanticTokensOptions.

Since:

  • 3.16.0



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

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

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

  @attributes.freeze
end

Instance Attribute Details

#attributesObject (readonly)

Since:

  • 3.16.0



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

def attributes
  @attributes
end

Instance Method Details

#fullboolean | { delta:boolean } | nil

Server supports providing semantic tokens for a full document.

Returns:

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

Since:

  • 3.16.0



40
41
42
# File 'lib/language_server/protocol/interface/semantic_tokens_options.rb', line 40

def full
  attributes.fetch(:full)
end

#legendSemanticTokensLegend

The legend used by the server

Returns:

Since:

  • 3.16.0



23
24
25
# File 'lib/language_server/protocol/interface/semantic_tokens_options.rb', line 23

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



32
33
34
# File 'lib/language_server/protocol/interface/semantic_tokens_options.rb', line 32

def range
  attributes.fetch(:range)
end

#to_hashObject

Since:

  • 3.16.0



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

def to_hash
  attributes
end

#to_json(*args) ⇒ Object

Since:

  • 3.16.0



55
56
57
# File 'lib/language_server/protocol/interface/semantic_tokens_options.rb', line 55

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

#work_done_progressboolean | nil

Returns:

  • (boolean | nil)

Since:

  • 3.16.0



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

def work_done_progress
  attributes.fetch(:workDoneProgress)
end