Class: LanguageServer::Protocol::Interface::SemanticTokensClientCapabilities
- Inherits:
-
Object
- Object
- LanguageServer::Protocol::Interface::SemanticTokensClientCapabilities
- Defined in:
- lib/language_server/protocol/interface/semantic_tokens_client_capabilities.rb
Instance Attribute Summary collapse
-
#attributes ⇒ Object
readonly
Returns the value of attribute attributes.
Instance Method Summary collapse
-
#dynamic_registration ⇒ boolean
Whether implementation supports dynamic registration.
-
#formats ⇒ "relative"[]
The formats the clients supports.
-
#initialize(dynamic_registration: nil, requests:, token_types:, token_modifiers:, formats:, overlapping_token_support: nil, multiline_token_support: nil) ⇒ SemanticTokensClientCapabilities
constructor
A new instance of SemanticTokensClientCapabilities.
-
#multiline_token_support ⇒ boolean
Whether the client supports tokens that can span multiple lines.
-
#overlapping_token_support ⇒ boolean
Whether the client supports tokens that can overlap each other.
-
#requests ⇒ { range?: boolean | {}; full?: boolean | { delta?: boolean; }; }
Which requests the client supports and might send to the server depending on the server’s capability.
- #to_hash ⇒ Object
- #to_json(*args) ⇒ Object
-
#token_modifiers ⇒ string[]
The token modifiers that the client supports.
-
#token_types ⇒ string[]
The token types that the client supports.
Constructor Details
#initialize(dynamic_registration: nil, requests:, token_types:, token_modifiers:, formats:, overlapping_token_support: nil, multiline_token_support: nil) ⇒ SemanticTokensClientCapabilities
Returns a new instance of SemanticTokensClientCapabilities.
5 6 7 8 9 10 11 12 13 14 15 16 17 |
# File 'lib/language_server/protocol/interface/semantic_tokens_client_capabilities.rb', line 5 def initialize(dynamic_registration: nil, requests:, token_types:, token_modifiers:, formats:, overlapping_token_support: nil, multiline_token_support: nil) @attributes = {} @attributes[:dynamicRegistration] = dynamic_registration if dynamic_registration @attributes[:requests] = requests @attributes[:tokenTypes] = token_types @attributes[:tokenModifiers] = token_modifiers @attributes[:formats] = formats @attributes[:overlappingTokenSupport] = overlapping_token_support if overlapping_token_support @attributes[:multilineTokenSupport] = multiline_token_support if multiline_token_support @attributes.freeze end |
Instance Attribute Details
#attributes ⇒ Object (readonly)
Returns the value of attribute attributes.
85 86 87 |
# File 'lib/language_server/protocol/interface/semantic_tokens_client_capabilities.rb', line 85 def attributes @attributes end |
Instance Method Details
#dynamic_registration ⇒ boolean
Whether implementation supports dynamic registration. If this is set to ‘true` the client supports the new `(TextDocumentRegistrationOptions & StaticRegistrationOptions)` return value for the corresponding server capability as well.
26 27 28 |
# File 'lib/language_server/protocol/interface/semantic_tokens_client_capabilities.rb', line 26 def dynamic_registration attributes.fetch(:dynamicRegistration) end |
#formats ⇒ "relative"[]
The formats the clients supports.
65 66 67 |
# File 'lib/language_server/protocol/interface/semantic_tokens_client_capabilities.rb', line 65 def formats attributes.fetch(:formats) end |
#multiline_token_support ⇒ boolean
Whether the client supports tokens that can span multiple lines.
81 82 83 |
# File 'lib/language_server/protocol/interface/semantic_tokens_client_capabilities.rb', line 81 def multiline_token_support attributes.fetch(:multilineTokenSupport) end |
#overlapping_token_support ⇒ boolean
Whether the client supports tokens that can overlap each other.
73 74 75 |
# File 'lib/language_server/protocol/interface/semantic_tokens_client_capabilities.rb', line 73 def overlapping_token_support attributes.fetch(:overlappingTokenSupport) end |
#requests ⇒ { range?: boolean | {}; full?: boolean | { delta?: boolean; }; }
Which requests the client supports and might send to the server depending on the server’s capability. Please note that clients might not show semantic tokens or degrade some of the user experience if a range or full request is advertised by the client but not provided by the server. If for example the client capability ‘requests.full` and `request.range` are both set to true but the server only provides a range provider the client might not render a minimap correctly or might even decide to not show any semantic tokens at all.
41 42 43 |
# File 'lib/language_server/protocol/interface/semantic_tokens_client_capabilities.rb', line 41 def requests attributes.fetch(:requests) end |
#to_hash ⇒ Object
87 88 89 |
# File 'lib/language_server/protocol/interface/semantic_tokens_client_capabilities.rb', line 87 def to_hash attributes end |
#to_json(*args) ⇒ Object
91 92 93 |
# File 'lib/language_server/protocol/interface/semantic_tokens_client_capabilities.rb', line 91 def to_json(*args) to_hash.to_json(*args) end |
#token_modifiers ⇒ string[]
The token modifiers that the client supports.
57 58 59 |
# File 'lib/language_server/protocol/interface/semantic_tokens_client_capabilities.rb', line 57 def token_modifiers attributes.fetch(:tokenModifiers) end |
#token_types ⇒ string[]
The token types that the client supports.
49 50 51 |
# File 'lib/language_server/protocol/interface/semantic_tokens_client_capabilities.rb', line 49 def token_types attributes.fetch(:tokenTypes) end |