Class: LanguageServer::Protocol::Interface::WorkspaceEditClientCapabilities
- Inherits:
-
Object
- Object
- LanguageServer::Protocol::Interface::WorkspaceEditClientCapabilities
- Defined in:
- lib/language_server/protocol/interface/workspace_edit_client_capabilities.rb
Instance Attribute Summary collapse
-
#attributes ⇒ Object
readonly
Returns the value of attribute attributes.
Instance Method Summary collapse
-
#change_annotation_support ⇒ { groupsOnLabel?: boolean; }
Whether the client in general supports change annotations on text edits, create file, rename file and delete file changes.
-
#document_changes ⇒ boolean
The client supports versioned document changes in ‘WorkspaceEdit`s.
-
#failure_handling ⇒ FailureHandlingKind
The failure handling strategy of a client if applying the workspace edit fails.
-
#initialize(document_changes: nil, resource_operations: nil, failure_handling: nil, normalizes_line_endings: nil, change_annotation_support: nil) ⇒ WorkspaceEditClientCapabilities
constructor
A new instance of WorkspaceEditClientCapabilities.
-
#normalizes_line_endings ⇒ boolean
Whether the client normalizes line endings to the client specific setting.
-
#resource_operations ⇒ ResourceOperationKind[]
The resource operations the client supports.
- #to_hash ⇒ Object
- #to_json(*args) ⇒ Object
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.
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
#attributes ⇒ Object (readonly)
Returns the value of attribute attributes.
63 64 65 |
# File 'lib/language_server/protocol/interface/workspace_edit_client_capabilities.rb', line 63 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.
59 60 61 |
# File 'lib/language_server/protocol/interface/workspace_edit_client_capabilities.rb', line 59 def change_annotation_support attributes.fetch(:changeAnnotationSupport) end |
#document_changes ⇒ boolean
The client supports versioned document changes in ‘WorkspaceEdit`s
21 22 23 |
# File 'lib/language_server/protocol/interface/workspace_edit_client_capabilities.rb', line 21 def document_changes attributes.fetch(:documentChanges) end |
#failure_handling ⇒ FailureHandlingKind
The failure handling strategy of a client if applying the workspace edit fails.
39 40 41 |
# File 'lib/language_server/protocol/interface/workspace_edit_client_capabilities.rb', line 39 def failure_handling attributes.fetch(:failureHandling) end |
#normalizes_line_endings ⇒ boolean
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 specific new line character(s).
50 51 52 |
# File 'lib/language_server/protocol/interface/workspace_edit_client_capabilities.rb', line 50 def normalizes_line_endings attributes.fetch(:normalizesLineEndings) end |
#resource_operations ⇒ ResourceOperationKind[]
The resource operations the client supports. Clients should at least support ‘create’, ‘rename’ and ‘delete’ files and folders.
30 31 32 |
# File 'lib/language_server/protocol/interface/workspace_edit_client_capabilities.rb', line 30 def resource_operations attributes.fetch(:resourceOperations) end |
#to_hash ⇒ Object
65 66 67 |
# File 'lib/language_server/protocol/interface/workspace_edit_client_capabilities.rb', line 65 def to_hash attributes end |
#to_json(*args) ⇒ Object
69 70 71 |
# File 'lib/language_server/protocol/interface/workspace_edit_client_capabilities.rb', line 69 def to_json(*args) to_hash.to_json(*args) end |