Class: LanguageServer::Protocol::Interface::WorkspaceEditClientCapabilities

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(document_changes: nil, resource_operations: nil, failure_handling: nil) ⇒ WorkspaceEditClientCapabilities

Returns a new instance of WorkspaceEditClientCapabilities.



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

def initialize(document_changes: nil, resource_operations: nil, failure_handling: nil)
  @attributes = {}

  @attributes[:documentChanges] = document_changes if document_changes
  @attributes[:resourceOperations] = resource_operations if resource_operations
  @attributes[:failureHandling] = failure_handling if failure_handling

  @attributes.freeze
end

Instance Attribute Details

#attributesObject (readonly)

Returns the value of attribute attributes.



41
42
43
# File 'lib/language_server/protocol/interface/workspace_edit_client_capabilities.rb', line 41

def attributes
  @attributes
end

Instance Method Details

#document_changesboolean

The client supports versioned document changes in ‘WorkspaceEdit`s

Returns:

  • (boolean)


19
20
21
# File 'lib/language_server/protocol/interface/workspace_edit_client_capabilities.rb', line 19

def document_changes
  attributes.fetch(:documentChanges)
end

#failure_handlingFailureHandlingKind

The failure handling strategy of a client if applying the workspace edit fails.

Returns:

  • (FailureHandlingKind)


37
38
39
# File 'lib/language_server/protocol/interface/workspace_edit_client_capabilities.rb', line 37

def failure_handling
  attributes.fetch(:failureHandling)
end

#resource_operationsResourceOperationKind[]

The resource operations the client supports. Clients should at least support ‘create’, ‘rename’ and ‘delete’ files and folders.

Returns:

  • (ResourceOperationKind[])


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

def resource_operations
  attributes.fetch(:resourceOperations)
end

#to_hashObject



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

def to_hash
  attributes
end

#to_json(*args) ⇒ Object



47
48
49
# File 'lib/language_server/protocol/interface/workspace_edit_client_capabilities.rb', line 47

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