Class: LanguageServer::Protocol::Interface::WorkspaceEdit
- Inherits:
-
Object
- Object
- LanguageServer::Protocol::Interface::WorkspaceEdit
- Defined in:
- lib/language_server/protocol/interface/workspace_edit.rb
Instance Attribute Summary collapse
-
#attributes ⇒ Object
readonly
Returns the value of attribute attributes.
Instance Method Summary collapse
-
#changes ⇒ { [uri: string]: TextEdit[]; }
Holds changes to existing resources.
-
#document_changes ⇒ TextDocumentEdit[]
An array of ‘TextDocumentEdit`s to express changes to specific a specific version of a text document.
-
#initialize(changes: nil, document_changes: nil) ⇒ WorkspaceEdit
constructor
A new instance of WorkspaceEdit.
- #to_json(*args) ⇒ Object
Constructor Details
#initialize(changes: nil, document_changes: nil) ⇒ WorkspaceEdit
Returns a new instance of WorkspaceEdit.
5 6 7 8 9 10 11 12 |
# File 'lib/language_server/protocol/interface/workspace_edit.rb', line 5 def initialize(changes: nil, document_changes: nil) @attributes = {} @attributes[:changes] = changes if changes @attributes[:documentChanges] = document_changes if document_changes @attributes.freeze end |
Instance Attribute Details
#attributes ⇒ Object (readonly)
Returns the value of attribute attributes.
32 33 34 |
# File 'lib/language_server/protocol/interface/workspace_edit.rb', line 32 def attributes @attributes end |
Instance Method Details
#changes ⇒ { [uri: string]: TextEdit[]; }
Holds changes to existing resources.
18 19 20 |
# File 'lib/language_server/protocol/interface/workspace_edit.rb', line 18 def changes attributes.fetch(:changes) end |
#document_changes ⇒ TextDocumentEdit[]
An array of ‘TextDocumentEdit`s to express changes to specific a specific version of a text document. Whether a client supports versioned document edits is expressed via `WorkspaceClientCapabilites.versionedWorkspaceEdit`.
28 29 30 |
# File 'lib/language_server/protocol/interface/workspace_edit.rb', line 28 def document_changes attributes.fetch(:documentChanges) end |
#to_json(*args) ⇒ Object
34 35 36 |
# File 'lib/language_server/protocol/interface/workspace_edit.rb', line 34 def to_json(*args) attributes.to_json(*args) end |