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

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

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

Returns a new instance of WorkspaceEditClientCapabilities.

Parameters:

  • document_changes: (Boolean) (defaults to: nil)
  • resource_operations: (Array[untyped]) (defaults to: nil)
  • failure_handling: (Object) (defaults to: nil)
  • normalizes_line_endings: (Boolean) (defaults to: nil)
  • change_annotation_support: (Object) (defaults to: nil)


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

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

  @attributes[:documentChanges] = document_changes if document_changes
  @attributes[:resourceOperations] = resource_operations if resource_operations
  @attributes[:failureHandling] = failure_handling if failure_handling
  @attributes[:normalizesLineEndings] = normalizes_line_endings if normalizes_line_endings
  @attributes[:changeAnnotationSupport] = change_annotation_support if change_annotation_support

  @attributes.freeze
end

Instance Attribute Details

#attributesHash[Symbol, untyped] (readonly)

Returns the value of attribute attributes.

Returns:

  • (Hash[Symbol, untyped])


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

def attributes
  @attributes
end

Instance Method Details

#change_annotation_support{ groupsOnLabel?: boolean; }

Whether the client in general supports change annotations on text edits, create file, rename file and delete file changes.

Returns:

  • ({ groupsOnLabel?: boolean; })

Since:

  • 3.16.0



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

def change_annotation_support
  attributes.fetch(:changeAnnotationSupport)
end

#document_changesboolean

The client supports versioned document changes in WorkspaceEdits

Returns:

  • (boolean)


21
22
23
# File 'lib/language_server/protocol/interface/workspace_edit_client_capabilities.rb', line 21

def document_changes
  attributes.fetch(:documentChanges)
end

#failure_handlingFailureHandlingKind

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

Returns:

  • (FailureHandlingKind)

Since:

  • 3.13.0



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

def failure_handling
  attributes.fetch(:failureHandling)
end

#normalizes_line_endingsboolean

Whether the client normalizes line endings to the client specific setting. If set to true the client will normalize line ending characters in a workspace edit to the client-specified new line character.

Returns:

  • (boolean)

Since:

  • 3.16.0



57
58
59
# File 'lib/language_server/protocol/interface/workspace_edit_client_capabilities.rb', line 57

def normalizes_line_endings
  attributes.fetch(:normalizesLineEndings)
end

#resource_operationsResourceOperationKind[]

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

Returns:

  • (ResourceOperationKind[])

Since:

  • 3.13.0



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

def resource_operations
  attributes.fetch(:resourceOperations)
end

#to_hashHash[Symbol, untyped]

Returns:

  • (Hash[Symbol, untyped])


74
75
76
# File 'lib/language_server/protocol/interface/workspace_edit_client_capabilities.rb', line 74

def to_hash
  attributes
end

#to_json(*args) ⇒ String

Parameters:

  • (Object)

Returns:

  • (String)


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

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