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

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

Overview

Since:

  • 3.16.0

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(refresh_support: nil) ⇒ SemanticTokensWorkspaceClientCapabilities

Returns a new instance of SemanticTokensWorkspaceClientCapabilities.

Parameters:

  • refresh_support: (Boolean) (defaults to: nil)

Since:

  • 3.16.0



8
9
10
11
12
13
14
# File 'lib/language_server/protocol/interface/semantic_tokens_workspace_client_capabilities.rb', line 8

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

  @attributes[:refreshSupport] = refresh_support if refresh_support

  @attributes.freeze
end

Instance Attribute Details

#attributesHash[Symbol, untyped] (readonly)

Returns:

  • (Hash[Symbol, untyped])

Since:

  • 3.16.0



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

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 detects a project wide change that requires such a calculation.

Returns:

  • (boolean)

Since:

  • 3.16.0



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

def refresh_support
  attributes.fetch(:refreshSupport)
end

#to_hashHash[Symbol, untyped]

Returns:

  • (Hash[Symbol, untyped])

Since:

  • 3.16.0



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

def to_hash
  attributes
end

#to_json(*args) ⇒ String

Parameters:

  • (Object)

Returns:

  • (String)

Since:

  • 3.16.0



36
37
38
# File 'lib/language_server/protocol/interface/semantic_tokens_workspace_client_capabilities.rb', line 36

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