Class: LanguageServer::Protocol::Interface::SemanticTokens
- Inherits:
-
Object
- Object
- LanguageServer::Protocol::Interface::SemanticTokens
- Defined in:
- lib/language_server/protocol/interface/semantic_tokens.rb
Instance Attribute Summary collapse
-
#attributes ⇒ Object
readonly
Returns the value of attribute attributes.
Instance Method Summary collapse
-
#data ⇒ number[]
The actual tokens.
-
#initialize(result_id: nil, data:) ⇒ SemanticTokens
constructor
A new instance of SemanticTokens.
-
#result_id ⇒ string
An optional result id.
- #to_hash ⇒ Object
- #to_json(*args) ⇒ Object
Constructor Details
#initialize(result_id: nil, data:) ⇒ SemanticTokens
Returns a new instance of SemanticTokens.
5 6 7 8 9 10 11 12 |
# File 'lib/language_server/protocol/interface/semantic_tokens.rb', line 5 def initialize(result_id: nil, data:) @attributes = {} @attributes[:resultId] = result_id if result_id @attributes[:data] = data @attributes.freeze end |
Instance Attribute Details
#attributes ⇒ Object (readonly)
Returns the value of attribute attributes.
33 34 35 |
# File 'lib/language_server/protocol/interface/semantic_tokens.rb', line 33 def attributes @attributes end |
Instance Method Details
#data ⇒ number[]
The actual tokens.
29 30 31 |
# File 'lib/language_server/protocol/interface/semantic_tokens.rb', line 29 def data attributes.fetch(:data) end |
#result_id ⇒ string
An optional result id. If provided and clients support delta updating the client will include the result id in the next semantic token request. A server can then instead of computing all semantic tokens again simply send a delta.
21 22 23 |
# File 'lib/language_server/protocol/interface/semantic_tokens.rb', line 21 def result_id attributes.fetch(:resultId) end |
#to_hash ⇒ Object
35 36 37 |
# File 'lib/language_server/protocol/interface/semantic_tokens.rb', line 35 def to_hash attributes end |
#to_json(*args) ⇒ Object
39 40 41 |
# File 'lib/language_server/protocol/interface/semantic_tokens.rb', line 39 def to_json(*args) to_hash.to_json(*args) end |