Class: LanguageServer::Protocol::Interface::TextDocumentContentChangeEvent
- Inherits:
-
Object
- Object
- LanguageServer::Protocol::Interface::TextDocumentContentChangeEvent
- Defined in:
- lib/language_server/protocol/interface/text_document_content_change_event.rb
Overview
An event describing a change to a text document. If only a text is provided it is considered to be the full content of the document.
Instance Attribute Summary collapse
-
#attributes ⇒ Object
readonly
Returns the value of attribute attributes.
Instance Method Summary collapse
-
#initialize(range:, range_length: nil, text:) ⇒ TextDocumentContentChangeEvent
constructor
A new instance of TextDocumentContentChangeEvent.
-
#range ⇒ Range
The range of the document that changed.
-
#range_length ⇒ uinteger | nil
deprecated
Deprecated.
use range instead.
-
#text ⇒ string
The new text for the provided range.
- #to_hash ⇒ Object
- #to_json(*args) ⇒ Object
Constructor Details
#initialize(range:, range_length: nil, text:) ⇒ TextDocumentContentChangeEvent
Returns a new instance of TextDocumentContentChangeEvent.
9 10 11 12 13 14 15 16 17 |
# File 'lib/language_server/protocol/interface/text_document_content_change_event.rb', line 9 def initialize(range:, range_length: nil, text:) @attributes = {} @attributes[:range] = range @attributes[:rangeLength] = range_length if range_length @attributes[:text] = text @attributes.freeze end |
Instance Attribute Details
#attributes ⇒ Object (readonly)
Returns the value of attribute attributes.
45 46 47 |
# File 'lib/language_server/protocol/interface/text_document_content_change_event.rb', line 45 def attributes @attributes end |
Instance Method Details
#range ⇒ Range
The range of the document that changed.
23 24 25 |
# File 'lib/language_server/protocol/interface/text_document_content_change_event.rb', line 23 def range attributes.fetch(:range) end |
#range_length ⇒ uinteger | nil
Deprecated.
use range instead.
The optional length of the range that got replaced.
33 34 35 |
# File 'lib/language_server/protocol/interface/text_document_content_change_event.rb', line 33 def range_length attributes.fetch(:rangeLength) end |
#text ⇒ string
The new text for the provided range.
41 42 43 |
# File 'lib/language_server/protocol/interface/text_document_content_change_event.rb', line 41 def text attributes.fetch(:text) end |
#to_hash ⇒ Object
47 48 49 |
# File 'lib/language_server/protocol/interface/text_document_content_change_event.rb', line 47 def to_hash attributes end |
#to_json(*args) ⇒ Object
51 52 53 |
# File 'lib/language_server/protocol/interface/text_document_content_change_event.rb', line 51 def to_json(*args) to_hash.to_json(*args) end |