Class: LanguageServer::Protocol::Interface::WorkspaceClientCapabilities

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

Overview

Workspace specific client capabilities.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(apply_edit: nil, workspace_edit: nil, did_change_configuration: nil, did_change_watched_files: nil, symbol: nil, execute_command: nil, workspace_folders: nil, configuration: nil, semantic_tokens: nil, code_lens: nil, file_operations: nil, inline_value: nil, inlay_hint: nil, diagnostics: nil) ⇒ WorkspaceClientCapabilities



8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# File 'lib/language_server/protocol/interface/workspace_client_capabilities.rb', line 8

def initialize(apply_edit: nil, workspace_edit: nil, did_change_configuration: nil, did_change_watched_files: nil, symbol: nil, execute_command: nil, workspace_folders: nil, configuration: nil, semantic_tokens: nil, code_lens: nil, file_operations: nil, inline_value: nil, inlay_hint: nil, diagnostics: nil)
  @attributes = {}

  @attributes[:applyEdit] = apply_edit if apply_edit
  @attributes[:workspaceEdit] = workspace_edit if workspace_edit
  @attributes[:didChangeConfiguration] = did_change_configuration if did_change_configuration
  @attributes[:didChangeWatchedFiles] = did_change_watched_files if did_change_watched_files
  @attributes[:symbol] = symbol if symbol
  @attributes[:executeCommand] = execute_command if execute_command
  @attributes[:workspaceFolders] = workspace_folders if workspace_folders
  @attributes[:configuration] = configuration if configuration
  @attributes[:semanticTokens] = semantic_tokens if semantic_tokens
  @attributes[:codeLens] = code_lens if code_lens
  @attributes[:fileOperations] = file_operations if file_operations
  @attributes[:inlineValue] = inline_value if inline_value
  @attributes[:inlayHint] = inlay_hint if inlay_hint
  @attributes[:diagnostics] = diagnostics if diagnostics

  @attributes.freeze
end

Instance Attribute Details

#attributesObject (readonly)

Returns the value of attribute attributes.



164
165
166
# File 'lib/language_server/protocol/interface/workspace_client_capabilities.rb', line 164

def attributes
  @attributes
end

Instance Method Details

#apply_editboolean | nil

The client supports applying batch edits to the workspace by supporting the request ‘workspace/applyEdit’



35
36
37
# File 'lib/language_server/protocol/interface/workspace_client_capabilities.rb', line 35

def apply_edit
  attributes.fetch(:applyEdit)
end

#code_lensCodeLensWorkspaceClientCapabilities | nil

Capabilities specific to the code lens requests scoped to the workspace.

Since:

  • 3.16.0.



117
118
119
# File 'lib/language_server/protocol/interface/workspace_client_capabilities.rb', line 117

def code_lens
  attributes.fetch(:codeLens)
end

#configurationboolean | nil

The client supports workspace/configuration requests.

Since:

  • 3.6.0



95
96
97
# File 'lib/language_server/protocol/interface/workspace_client_capabilities.rb', line 95

def configuration
  attributes.fetch(:configuration)
end

#diagnosticsDiagnosticWorkspaceClientCapabilities | nil

Capabilities specific to the diagnostic requests scoped to the workspace.

Since:

  • 3.17.0.



160
161
162
# File 'lib/language_server/protocol/interface/workspace_client_capabilities.rb', line 160

def diagnostics
  attributes.fetch(:diagnostics)
end

#did_change_configurationDidChangeConfigurationClientCapabilities | nil

Capabilities specific to the workspace/didChangeConfiguration notification.



51
52
53
# File 'lib/language_server/protocol/interface/workspace_client_capabilities.rb', line 51

def did_change_configuration
  attributes.fetch(:didChangeConfiguration)
end

#did_change_watched_filesDidChangeWatchedFilesClientCapabilities | nil

Capabilities specific to the workspace/didChangeWatchedFiles notification.



59
60
61
# File 'lib/language_server/protocol/interface/workspace_client_capabilities.rb', line 59

def did_change_watched_files
  attributes.fetch(:didChangeWatchedFiles)
end

#execute_commandExecuteCommandClientCapabilities | nil

Capabilities specific to the workspace/executeCommand request.



75
76
77
# File 'lib/language_server/protocol/interface/workspace_client_capabilities.rb', line 75

def execute_command
  attributes.fetch(:executeCommand)
end

#file_operationsFileOperationClientCapabilities | nil

The client has support for file notifications/requests for user operations on files.

Since 3.16.0



127
128
129
# File 'lib/language_server/protocol/interface/workspace_client_capabilities.rb', line 127

def file_operations
  attributes.fetch(:fileOperations)
end

#inlay_hintInlayHintWorkspaceClientCapabilities | nil

Capabilities specific to the inlay hint requests scoped to the workspace.

Since:

  • 3.17.0.



149
150
151
# File 'lib/language_server/protocol/interface/workspace_client_capabilities.rb', line 149

def inlay_hint
  attributes.fetch(:inlayHint)
end

#inline_valueInlineValueWorkspaceClientCapabilities | nil

Capabilities specific to the inline values requests scoped to the workspace.

Since:

  • 3.17.0.



138
139
140
# File 'lib/language_server/protocol/interface/workspace_client_capabilities.rb', line 138

def inline_value
  attributes.fetch(:inlineValue)
end

#semantic_tokensSemanticTokensWorkspaceClientCapabilities | nil

Capabilities specific to the semantic token requests scoped to the workspace.

Since:

  • 3.16.0.



106
107
108
# File 'lib/language_server/protocol/interface/workspace_client_capabilities.rb', line 106

def semantic_tokens
  attributes.fetch(:semanticTokens)
end

#symbolWorkspaceSymbolClientCapabilities | nil

Capabilities specific to the workspace/symbol request.



67
68
69
# File 'lib/language_server/protocol/interface/workspace_client_capabilities.rb', line 67

def symbol
  attributes.fetch(:symbol)
end

#to_hashObject



166
167
168
# File 'lib/language_server/protocol/interface/workspace_client_capabilities.rb', line 166

def to_hash
  attributes
end

#to_json(*args) ⇒ Object



170
171
172
# File 'lib/language_server/protocol/interface/workspace_client_capabilities.rb', line 170

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

#workspace_editWorkspaceEditClientCapabilities | nil

Capabilities specific to ‘WorkspaceEdit`s.



43
44
45
# File 'lib/language_server/protocol/interface/workspace_client_capabilities.rb', line 43

def workspace_edit
  attributes.fetch(:workspaceEdit)
end

#workspace_foldersboolean | nil

The client has support for workspace folders.

Since:

  • 3.6.0



85
86
87
# File 'lib/language_server/protocol/interface/workspace_client_capabilities.rb', line 85

def workspace_folders
  attributes.fetch(:workspaceFolders)
end