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

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

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.

Parameters:

  • document_selector: (Object)
  • legend: (Object)
  • range: (Object) (defaults to: nil)
  • full: (Object) (defaults to: nil)
  • work_done_progress: (Boolean) (defaults to: nil)
  • id: (String) (defaults to: nil)

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

#attributesHash[Symbol, untyped] (readonly)

Returns:

  • (Hash[Symbol, untyped])

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 | nil

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 | nil)

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; }

Server supports providing semantic tokens for a full document.

Returns:

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

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

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

Returns:

  • (string)

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 | { ; }

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

Returns:

  • (boolean | { ; })

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_hashHash[Symbol, untyped]

Returns:

  • (Hash[Symbol, untyped])

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) ⇒ String

Parameters:

  • (Object)

Returns:

  • (String)

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

Returns:

  • (boolean)

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