Class: LanguageServer::Protocol::Interface::TextDocumentEdit
- Inherits:
-
Object
- Object
- LanguageServer::Protocol::Interface::TextDocumentEdit
- Defined in:
- lib/language_server/protocol/interface/text_document_edit.rb
Overview
Describes textual changes on a text document. A TextDocumentEdit describes all changes on a document version Si and after they are applied move the document to version Si+1. So the creator of a TextDocumentEdit doesn’t need to sort the array of edits or do any kind of ordering. However the edits must be non overlapping.
Instance Attribute Summary collapse
-
#attributes ⇒ Object
readonly
Returns the value of attribute attributes.
Instance Method Summary collapse
-
#edits ⇒ TextEdit | AnnotatedTextEdit[]
The edits to be applied.
-
#initialize(text_document:, edits:) ⇒ TextDocumentEdit
constructor
A new instance of TextDocumentEdit.
-
#text_document ⇒ OptionalVersionedTextDocumentIdentifier
The text document to change.
- #to_hash ⇒ Object
- #to_json(*args) ⇒ Object
Constructor Details
#initialize(text_document:, edits:) ⇒ TextDocumentEdit
Returns a new instance of TextDocumentEdit.
11 12 13 14 15 16 17 18 |
# File 'lib/language_server/protocol/interface/text_document_edit.rb', line 11 def initialize(text_document:, edits:) @attributes = {} @attributes[:textDocument] = text_document @attributes[:edits] = edits @attributes.freeze end |
Instance Attribute Details
#attributes ⇒ Object (readonly)
Returns the value of attribute attributes.
39 40 41 |
# File 'lib/language_server/protocol/interface/text_document_edit.rb', line 39 def attributes @attributes end |
Instance Method Details
#edits ⇒ TextEdit | AnnotatedTextEdit[]
The edits to be applied.
client capability.
35 36 37 |
# File 'lib/language_server/protocol/interface/text_document_edit.rb', line 35 def edits attributes.fetch(:edits) end |
#text_document ⇒ OptionalVersionedTextDocumentIdentifier
The text document to change.
24 25 26 |
# File 'lib/language_server/protocol/interface/text_document_edit.rb', line 24 def text_document attributes.fetch(:textDocument) end |
#to_hash ⇒ Object
41 42 43 |
# File 'lib/language_server/protocol/interface/text_document_edit.rb', line 41 def to_hash attributes end |
#to_json(*args) ⇒ Object
45 46 47 |
# File 'lib/language_server/protocol/interface/text_document_edit.rb', line 45 def to_json(*args) to_hash.to_json(*args) end |