Class: LanguageServer::Protocol::Interface::TextDocumentItem
- Inherits:
-
Object
- Object
- LanguageServer::Protocol::Interface::TextDocumentItem
- Defined in:
- lib/language_server/protocol/interface/text_document_item.rb
Instance Attribute Summary collapse
-
#attributes ⇒ Object
readonly
Returns the value of attribute attributes.
Instance Method Summary collapse
-
#initialize(uri:, language_id:, version:, text:) ⇒ TextDocumentItem
constructor
A new instance of TextDocumentItem.
-
#language_id ⇒ string
The text document’s language identifier.
-
#text ⇒ string
The content of the opened text document.
- #to_hash ⇒ Object
- #to_json(*args) ⇒ Object
-
#uri ⇒ string
The text document’s URI.
-
#version ⇒ number
The version number of this document (it will increase after each change, including undo/redo).
Constructor Details
#initialize(uri:, language_id:, version:, text:) ⇒ TextDocumentItem
Returns a new instance of TextDocumentItem.
5 6 7 8 9 10 11 12 13 14 |
# File 'lib/language_server/protocol/interface/text_document_item.rb', line 5 def initialize(uri:, language_id:, version:, text:) @attributes = {} @attributes[:uri] = uri @attributes[:languageId] = language_id @attributes[:version] = version @attributes[:text] = text @attributes.freeze end |
Instance Attribute Details
#attributes ⇒ Object (readonly)
Returns the value of attribute attributes.
49 50 51 |
# File 'lib/language_server/protocol/interface/text_document_item.rb', line 49 def attributes @attributes end |
Instance Method Details
#language_id ⇒ string
The text document’s language identifier.
28 29 30 |
# File 'lib/language_server/protocol/interface/text_document_item.rb', line 28 def language_id attributes.fetch(:languageId) end |
#text ⇒ string
The content of the opened text document.
45 46 47 |
# File 'lib/language_server/protocol/interface/text_document_item.rb', line 45 def text attributes.fetch(:text) end |
#to_hash ⇒ Object
51 52 53 |
# File 'lib/language_server/protocol/interface/text_document_item.rb', line 51 def to_hash attributes end |
#to_json(*args) ⇒ Object
55 56 57 |
# File 'lib/language_server/protocol/interface/text_document_item.rb', line 55 def to_json(*args) to_hash.to_json(*args) end |
#uri ⇒ string
The text document’s URI.
20 21 22 |
# File 'lib/language_server/protocol/interface/text_document_item.rb', line 20 def uri attributes.fetch(:uri) end |
#version ⇒ number
The version number of this document (it will increase after each change, including undo/redo).
37 38 39 |
# File 'lib/language_server/protocol/interface/text_document_item.rb', line 37 def version attributes.fetch(:version) end |