Class: LanguageServer::Protocol::Interface::SemanticTokens
- Inherits:
-
Object
- Object
- LanguageServer::Protocol::Interface::SemanticTokens
- Defined in:
- lib/language_server/protocol/interface/semantic_tokens.rb
Overview
Instance Attribute Summary collapse
- #attributes ⇒ Object readonly
Instance Method Summary collapse
-
#data ⇒ uinteger[]
The actual tokens.
-
#initialize(result_id: nil, data:) ⇒ SemanticTokens
constructor
A new instance of SemanticTokens.
-
#result_id ⇒ string | nil
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.
8 9 10 11 12 13 14 15 |
# File 'lib/language_server/protocol/interface/semantic_tokens.rb', line 8 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)
36 37 38 |
# File 'lib/language_server/protocol/interface/semantic_tokens.rb', line 36 def attributes @attributes end |
Instance Method Details
#data ⇒ uinteger[]
The actual tokens.
32 33 34 |
# File 'lib/language_server/protocol/interface/semantic_tokens.rb', line 32 def data attributes.fetch(:data) end |
#result_id ⇒ string | nil
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.
24 25 26 |
# File 'lib/language_server/protocol/interface/semantic_tokens.rb', line 24 def result_id attributes.fetch(:resultId) end |
#to_hash ⇒ Object
38 39 40 |
# File 'lib/language_server/protocol/interface/semantic_tokens.rb', line 38 def to_hash attributes end |
#to_json(*args) ⇒ Object
42 43 44 |
# File 'lib/language_server/protocol/interface/semantic_tokens.rb', line 42 def to_json(*args) to_hash.to_json(*args) end |