Class: LanguageServer::Protocol::Interface::SemanticTokensWorkspaceClientCapabilities

Inherits:
Object
  • Object
show all
Defined in:
lib/language_server/protocol/interface/semantic_tokens_workspace_client_capabilities.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(refresh_support: nil) ⇒ SemanticTokensWorkspaceClientCapabilities

Returns a new instance of SemanticTokensWorkspaceClientCapabilities.



5
6
7
8
9
10
11
# File 'lib/language_server/protocol/interface/semantic_tokens_workspace_client_capabilities.rb', line 5

def initialize(refresh_support: nil)
  @attributes = {}

  @attributes[:refreshSupport] = refresh_support if refresh_support

  @attributes.freeze
end

Instance Attribute Details

#attributesObject (readonly)

Returns the value of attribute attributes.



27
28
29
# File 'lib/language_server/protocol/interface/semantic_tokens_workspace_client_capabilities.rb', line 27

def attributes
  @attributes
end

Instance Method Details

#refresh_supportboolean

Whether the client implementation supports a refresh request sent from the server to the client.

Note that this event is global and will force the client to refresh all semantic tokens currently shown. It should be used with absolute care and is useful for situation where a server for example detect a project wide change that requires such a calculation.

Returns:

  • (boolean)


23
24
25
# File 'lib/language_server/protocol/interface/semantic_tokens_workspace_client_capabilities.rb', line 23

def refresh_support
  attributes.fetch(:refreshSupport)
end

#to_hashObject



29
30
31
# File 'lib/language_server/protocol/interface/semantic_tokens_workspace_client_capabilities.rb', line 29

def to_hash
  attributes
end

#to_json(*args) ⇒ Object



33
34
35
# File 'lib/language_server/protocol/interface/semantic_tokens_workspace_client_capabilities.rb', line 33

def to_json(*args)
  to_hash.to_json(*args)
end