Class: LanguageServer::Protocol::Interface::WorkspaceClientCapabilites

Inherits:
Object
  • Object
show all
Defined in:
lib/language_server/protocol/interface/workspace_client_capabilites.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) ⇒ WorkspaceClientCapabilites

Returns a new instance of WorkspaceClientCapabilites.



8
9
10
11
12
13
14
15
16
17
18
19
# File 'lib/language_server/protocol/interface/workspace_client_capabilites.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)
  @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.freeze
end

Instance Attribute Details

#attributesObject (readonly)

Returns the value of attribute attributes.



70
71
72
# File 'lib/language_server/protocol/interface/workspace_client_capabilites.rb', line 70

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)


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

def apply_edit
  attributes.fetch(:applyEdit)
end

#did_change_configuration{ dynamicRegistration?: boolean; }

Capabilities specific to the ‘workspace/didChangeConfiguration` notification.

Returns:

  • ({ dynamicRegistration?: boolean; })


42
43
44
# File 'lib/language_server/protocol/interface/workspace_client_capabilites.rb', line 42

def did_change_configuration
  attributes.fetch(:didChangeConfiguration)
end

#did_change_watched_files{ dynamicRegistration?: boolean; }

Capabilities specific to the ‘workspace/didChangeWatchedFiles` notification.

Returns:

  • ({ dynamicRegistration?: boolean; })


50
51
52
# File 'lib/language_server/protocol/interface/workspace_client_capabilites.rb', line 50

def did_change_watched_files
  attributes.fetch(:didChangeWatchedFiles)
end

#execute_command{ dynamicRegistration?: boolean; }

Capabilities specific to the ‘workspace/executeCommand` request.

Returns:

  • ({ dynamicRegistration?: boolean; })


66
67
68
# File 'lib/language_server/protocol/interface/workspace_client_capabilites.rb', line 66

def execute_command
  attributes.fetch(:executeCommand)
end

#symbol{ dynamicRegistration?: boolean; }

Capabilities specific to the ‘workspace/symbol` request.

Returns:

  • ({ dynamicRegistration?: boolean; })


58
59
60
# File 'lib/language_server/protocol/interface/workspace_client_capabilites.rb', line 58

def symbol
  attributes.fetch(:symbol)
end

#to_hashObject



72
73
74
# File 'lib/language_server/protocol/interface/workspace_client_capabilites.rb', line 72

def to_hash
  attributes
end

#to_json(*args) ⇒ Object



76
77
78
# File 'lib/language_server/protocol/interface/workspace_client_capabilites.rb', line 76

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

#workspace_edit{ documentChanges?: boolean; }

Capabilities specific to ‘WorkspaceEdit`s

Returns:

  • ({ documentChanges?: boolean; })


34
35
36
# File 'lib/language_server/protocol/interface/workspace_client_capabilites.rb', line 34

def workspace_edit
  attributes.fetch(:workspaceEdit)
end