Class: LanguageServer::Protocol::Interface::SemanticTokensClientCapabilities
- Inherits:
-
Object
- Object
- LanguageServer::Protocol::Interface::SemanticTokensClientCapabilities
- Defined in:
- lib/language_server/protocol/interface/semantic_tokens_client_capabilities.rb
Overview
Instance Attribute Summary collapse
- #attributes ⇒ Object readonly
Instance Method Summary collapse
-
#augments_syntax_tokens ⇒ boolean | nil
Whether the client uses semantic tokens to augment existing syntax tokens.
-
#dynamic_registration ⇒ boolean | nil
Whether implementation supports dynamic registration.
-
#formats ⇒ TokenFormat[]
The token formats the clients supports.
-
#initialize(dynamic_registration: nil, requests:, token_types:, token_modifiers:, formats:, overlapping_token_support: nil, multiline_token_support: nil, server_cancel_support: nil, augments_syntax_tokens: nil) ⇒ SemanticTokensClientCapabilities
constructor
A new instance of SemanticTokensClientCapabilities.
-
#multiline_token_support ⇒ boolean | nil
Whether the client supports tokens that can span multiple lines.
-
#overlapping_token_support ⇒ boolean | nil
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.
-
#server_cancel_support ⇒ boolean | nil
Whether the client allows the server to actively cancel a semantic token request, e.g.
- #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, server_cancel_support: nil, augments_syntax_tokens: nil) ⇒ SemanticTokensClientCapabilities
Returns a new instance of SemanticTokensClientCapabilities.
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/language_server/protocol/interface/semantic_tokens_client_capabilities.rb', line 8 def initialize(dynamic_registration: nil, requests:, token_types:, token_modifiers:, formats:, overlapping_token_support: nil, multiline_token_support: nil, server_cancel_support: nil, augments_syntax_tokens: 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[:serverCancelSupport] = server_cancel_support if server_cancel_support @attributes[:augmentsSyntaxTokens] = augments_syntax_tokens if augments_syntax_tokens @attributes.freeze end |
Instance Attribute Details
#attributes ⇒ Object (readonly)
119 120 121 |
# File 'lib/language_server/protocol/interface/semantic_tokens_client_capabilities.rb', line 119 def attributes @attributes end |
Instance Method Details
#augments_syntax_tokens ⇒ boolean | nil
Whether the client uses semantic tokens to augment existing syntax tokens. If set to true client side created syntax tokens and semantic tokens are both used for colorization. If set to false the client only uses the returned semantic tokens for colorization.
If the value is undefined then the client behavior is not specified.
115 116 117 |
# File 'lib/language_server/protocol/interface/semantic_tokens_client_capabilities.rb', line 115 def augments_syntax_tokens attributes.fetch(:augmentsSyntaxTokens) end |
#dynamic_registration ⇒ boolean | nil
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.
30 31 32 |
# File 'lib/language_server/protocol/interface/semantic_tokens_client_capabilities.rb', line 30 def dynamic_registration attributes.fetch(:dynamicRegistration) end |
#formats ⇒ TokenFormat[]
The token formats the clients supports.
69 70 71 |
# File 'lib/language_server/protocol/interface/semantic_tokens_client_capabilities.rb', line 69 def formats attributes.fetch(:formats) end |
#multiline_token_support ⇒ boolean | nil
Whether the client supports tokens that can span multiple lines.
85 86 87 |
# File 'lib/language_server/protocol/interface/semantic_tokens_client_capabilities.rb', line 85 def multiline_token_support attributes.fetch(:multilineTokenSupport) end |
#overlapping_token_support ⇒ boolean | nil
Whether the client supports tokens that can overlap each other.
77 78 79 |
# File 'lib/language_server/protocol/interface/semantic_tokens_client_capabilities.rb', line 77 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.
45 46 47 |
# File 'lib/language_server/protocol/interface/semantic_tokens_client_capabilities.rb', line 45 def requests attributes.fetch(:requests) end |
#server_cancel_support ⇒ boolean | nil
Whether the client allows the server to actively cancel a semantic token request, e.g. supports returning LSPErrorCodes.ServerCancelled. If a server does the client needs to retrigger the request.
98 99 100 |
# File 'lib/language_server/protocol/interface/semantic_tokens_client_capabilities.rb', line 98 def server_cancel_support attributes.fetch(:serverCancelSupport) end |
#to_hash ⇒ Object
121 122 123 |
# File 'lib/language_server/protocol/interface/semantic_tokens_client_capabilities.rb', line 121 def to_hash attributes end |
#to_json(*args) ⇒ Object
125 126 127 |
# File 'lib/language_server/protocol/interface/semantic_tokens_client_capabilities.rb', line 125 def to_json(*args) to_hash.to_json(*args) end |
#token_modifiers ⇒ string[]
The token modifiers that the client supports.
61 62 63 |
# File 'lib/language_server/protocol/interface/semantic_tokens_client_capabilities.rb', line 61 def token_modifiers attributes.fetch(:tokenModifiers) end |
#token_types ⇒ string[]
The token types that the client supports.
53 54 55 |
# File 'lib/language_server/protocol/interface/semantic_tokens_client_capabilities.rb', line 53 def token_types attributes.fetch(:tokenTypes) end |