Class: LanguageServer::Protocol::Interface::AnnotatedTextEdit
- Inherits:
-
Object
- Object
- LanguageServer::Protocol::Interface::AnnotatedTextEdit
- Defined in:
- lib/language_server/protocol/interface/annotated_text_edit.rb
Overview
A special text edit with an additional change annotation.
Instance Attribute Summary collapse
- #attributes ⇒ Object readonly
Instance Method Summary collapse
-
#annotation_id ⇒ ChangeAnnotationIdentifier
The actual identifier of the change annotation.
-
#initialize(annotation_id:, range:, new_text:) ⇒ AnnotatedTextEdit
constructor
A new instance of AnnotatedTextEdit.
-
#new_text ⇒ string
The string to be inserted.
-
#range ⇒ Range
The range of the text document to be manipulated.
- #to_hash ⇒ Object
- #to_json(*args) ⇒ Object
Constructor Details
#initialize(annotation_id:, range:, new_text:) ⇒ AnnotatedTextEdit
Returns a new instance of AnnotatedTextEdit.
10 11 12 13 14 15 16 17 18 |
# File 'lib/language_server/protocol/interface/annotated_text_edit.rb', line 10 def initialize(annotation_id:, range:, new_text:) @attributes = {} @attributes[:annotationId] = annotation_id @attributes[:range] = range @attributes[:newText] = new_text @attributes.freeze end |
Instance Attribute Details
#attributes ⇒ Object (readonly)
46 47 48 |
# File 'lib/language_server/protocol/interface/annotated_text_edit.rb', line 46 def attributes @attributes end |
Instance Method Details
#annotation_id ⇒ ChangeAnnotationIdentifier
The actual identifier of the change annotation
24 25 26 |
# File 'lib/language_server/protocol/interface/annotated_text_edit.rb', line 24 def annotation_id attributes.fetch(:annotationId) end |
#new_text ⇒ string
The string to be inserted. For delete operations use an empty string.
42 43 44 |
# File 'lib/language_server/protocol/interface/annotated_text_edit.rb', line 42 def new_text attributes.fetch(:newText) end |
#range ⇒ Range
The range of the text document to be manipulated. To insert text into a document create a range where start === end.
33 34 35 |
# File 'lib/language_server/protocol/interface/annotated_text_edit.rb', line 33 def range attributes.fetch(:range) end |
#to_hash ⇒ Object
48 49 50 |
# File 'lib/language_server/protocol/interface/annotated_text_edit.rb', line 48 def to_hash attributes end |
#to_json(*args) ⇒ Object
52 53 54 |
# File 'lib/language_server/protocol/interface/annotated_text_edit.rb', line 52 def to_json(*args) to_hash.to_json(*args) end |