Class: LanguageServer::Protocol::Interface::SemanticTokensLegend
- Inherits:
-
Object
- Object
- LanguageServer::Protocol::Interface::SemanticTokensLegend
- Defined in:
- lib/language_server/protocol/interface/semantic_tokens_legend.rb
Overview
Instance Attribute Summary collapse
- #attributes ⇒ Object readonly
Instance Method Summary collapse
-
#initialize(token_types:, token_modifiers:) ⇒ SemanticTokensLegend
constructor
A new instance of SemanticTokensLegend.
- #to_hash ⇒ Object
- #to_json(*args) ⇒ Object
-
#token_modifiers ⇒ string[]
The token modifiers a server uses.
-
#token_types ⇒ string[]
The token types a server uses.
Constructor Details
#initialize(token_types:, token_modifiers:) ⇒ SemanticTokensLegend
Returns a new instance of SemanticTokensLegend.
8 9 10 11 12 13 14 15 |
# File 'lib/language_server/protocol/interface/semantic_tokens_legend.rb', line 8 def initialize(token_types:, token_modifiers:) @attributes = {} @attributes[:tokenTypes] = token_types @attributes[:tokenModifiers] = token_modifiers @attributes.freeze end |
Instance Attribute Details
#attributes ⇒ Object (readonly)
33 34 35 |
# File 'lib/language_server/protocol/interface/semantic_tokens_legend.rb', line 33 def attributes @attributes end |
Instance Method Details
#to_hash ⇒ Object
35 36 37 |
# File 'lib/language_server/protocol/interface/semantic_tokens_legend.rb', line 35 def to_hash attributes end |
#to_json(*args) ⇒ Object
39 40 41 |
# File 'lib/language_server/protocol/interface/semantic_tokens_legend.rb', line 39 def to_json(*args) to_hash.to_json(*args) end |
#token_modifiers ⇒ string[]
The token modifiers a server uses.
29 30 31 |
# File 'lib/language_server/protocol/interface/semantic_tokens_legend.rb', line 29 def token_modifiers attributes.fetch(:tokenModifiers) end |
#token_types ⇒ string[]
The token types a server uses.
21 22 23 |
# File 'lib/language_server/protocol/interface/semantic_tokens_legend.rb', line 21 def token_types attributes.fetch(:tokenTypes) end |