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) ⇒ WorkspaceClientCapabilities

Returns a new instance of WorkspaceClientCapabilities.



8
9
10
11
12
13
14
15
16
17
18
19
20
21
# 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)
  @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.freeze
end

Instance Attribute Details

#attributesObject (readonly)

Returns the value of attribute attributes.



92
93
94
# File 'lib/language_server/protocol/interface/workspace_client_capabilities.rb', line 92

def attributes
  @attributes
end

Instance Method Details

#apply_editboolean

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

Returns:

  • (boolean)


28
29
30
# File 'lib/language_server/protocol/interface/workspace_client_capabilities.rb', line 28

def apply_edit
  attributes.fetch(:applyEdit)
end

#configurationboolean

The client supports ‘workspace/configuration` requests.

Since 3.6.0

Returns:

  • (boolean)


88
89
90
# File 'lib/language_server/protocol/interface/workspace_client_capabilities.rb', line 88

def configuration
  attributes.fetch(:configuration)
end

#did_change_configuration{ dynamicRegistration?: boolean; }

Capabilities specific to the ‘workspace/didChangeConfiguration` notification.

Returns:

  • ({ dynamicRegistration?: boolean; })


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

def did_change_configuration
  attributes.fetch(:didChangeConfiguration)
end

#did_change_watched_files{ dynamicRegistration?: boolean; }

Capabilities specific to the ‘workspace/didChangeWatchedFiles` notification.

Returns:

  • ({ dynamicRegistration?: boolean; })


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

def did_change_watched_files
  attributes.fetch(:didChangeWatchedFiles)
end

#execute_command{ dynamicRegistration?: boolean; }

Capabilities specific to the ‘workspace/executeCommand` request.

Returns:

  • ({ dynamicRegistration?: boolean; })


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

def execute_command
  attributes.fetch(:executeCommand)
end

#symbol{ dynamicRegistration?: boolean; symbolKind?: { valueSet?: any[]; }; }

Capabilities specific to the ‘workspace/symbol` request.

Returns:

  • ({ dynamicRegistration?: boolean; symbolKind?: { valueSet?: any[]; }; })


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

def symbol
  attributes.fetch(:symbol)
end

#to_hashObject



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

def to_hash
  attributes
end

#to_json(*args) ⇒ Object



98
99
100
# File 'lib/language_server/protocol/interface/workspace_client_capabilities.rb', line 98

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

#workspace_edit{ documentChanges?: boolean; resourceOperations?: ResourceOperationKind[]; failureHandling?: Fail...]

Capabilities specific to ‘WorkspaceEdit`s

Returns:

  • ({ documentChanges?: boolean; resourceOperations?: ResourceOperationKind[]; failureHandling?: Fail...])

    { documentChanges?: boolean; resourceOperations?: ResourceOperationKind[]; failureHandling?: Fail…]



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

def workspace_edit
  attributes.fetch(:workspaceEdit)
end

#workspace_foldersboolean

The client has support for workspace folders.

Since 3.6.0

Returns:

  • (boolean)


78
79
80
# File 'lib/language_server/protocol/interface/workspace_client_capabilities.rb', line 78

def workspace_folders
  attributes.fetch(:workspaceFolders)
end