Class: LanguageServer::Protocol::Interface::TextDocumentItem
- Inherits:
-
Object
- Object
- LanguageServer::Protocol::Interface::TextDocumentItem
- Defined in:
- lib/language_server/protocol/interface/text_document_item.rb
Overview
An item to transfer a text document from the client to the server.
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 ⇒ DocumentUri
The text document’s uri.
-
#version ⇒ integer
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.
9 10 11 12 13 14 15 16 17 18 |
# File 'lib/language_server/protocol/interface/text_document_item.rb', line 9 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.
53 54 55 |
# File 'lib/language_server/protocol/interface/text_document_item.rb', line 53 def attributes @attributes end |
Instance Method Details
#language_id ⇒ string
The text document’s language identifier.
32 33 34 |
# File 'lib/language_server/protocol/interface/text_document_item.rb', line 32 def language_id attributes.fetch(:languageId) end |
#text ⇒ string
The content of the opened text document.
49 50 51 |
# File 'lib/language_server/protocol/interface/text_document_item.rb', line 49 def text attributes.fetch(:text) end |
#to_hash ⇒ Object
55 56 57 |
# File 'lib/language_server/protocol/interface/text_document_item.rb', line 55 def to_hash attributes end |
#to_json(*args) ⇒ Object
59 60 61 |
# File 'lib/language_server/protocol/interface/text_document_item.rb', line 59 def to_json(*args) to_hash.to_json(*args) end |
#uri ⇒ DocumentUri
The text document’s uri.
24 25 26 |
# File 'lib/language_server/protocol/interface/text_document_item.rb', line 24 def uri attributes.fetch(:uri) end |
#version ⇒ integer
The version number of this document (it will increase after each change, including undo/redo).
41 42 43 |
# File 'lib/language_server/protocol/interface/text_document_item.rb', line 41 def version attributes.fetch(:version) end |