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
Returns the value of attribute attributes.
Instance Method Summary collapse
-
#annotation_id ⇒ string
The actual annotation identifier.
-
#initialize(range:, new_text:, annotation_id:) ⇒ 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(range:, new_text:, annotation_id:) ⇒ AnnotatedTextEdit
Returns a new instance of AnnotatedTextEdit.
8 9 10 11 12 13 14 15 16 |
# File 'lib/language_server/protocol/interface/annotated_text_edit.rb', line 8 def initialize(range:, new_text:, annotation_id:) @attributes = {} @attributes[:range] = range @attributes[:newText] = new_text @attributes[:annotationId] = annotation_id @attributes.freeze end |
Instance Attribute Details
#attributes ⇒ Object (readonly)
Returns the value of attribute attributes.
44 45 46 |
# File 'lib/language_server/protocol/interface/annotated_text_edit.rb', line 44 def attributes @attributes end |
Instance Method Details
#annotation_id ⇒ string
The actual annotation identifier.
40 41 42 |
# File 'lib/language_server/protocol/interface/annotated_text_edit.rb', line 40 def annotation_id attributes.fetch(:annotationId) end |
#new_text ⇒ string
The string to be inserted. For delete operations use an empty string.
32 33 34 |
# File 'lib/language_server/protocol/interface/annotated_text_edit.rb', line 32 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.
23 24 25 |
# File 'lib/language_server/protocol/interface/annotated_text_edit.rb', line 23 def range attributes.fetch(:range) end |
#to_hash ⇒ Object
46 47 48 |
# File 'lib/language_server/protocol/interface/annotated_text_edit.rb', line 46 def to_hash attributes end |
#to_json(*args) ⇒ Object
50 51 52 |
# File 'lib/language_server/protocol/interface/annotated_text_edit.rb', line 50 def to_json(*args) to_hash.to_json(*args) end |