Class: LanguageServer::Protocol::Interface::VersionedTextDocumentIdentifier
- Inherits:
-
TextDocumentIdentifier
- Object
- TextDocumentIdentifier
- LanguageServer::Protocol::Interface::VersionedTextDocumentIdentifier
- Defined in:
- lib/language_server/protocol/interface/versioned_text_document_identifier.rb
Instance Attribute Summary collapse
-
#attributes ⇒ Object
readonly
Returns the value of attribute attributes.
Instance Method Summary collapse
-
#initialize(uri:, version:) ⇒ VersionedTextDocumentIdentifier
constructor
A new instance of VersionedTextDocumentIdentifier.
- #to_hash ⇒ Object
- #to_json(*args) ⇒ Object
-
#version ⇒ number
The version number of this document.
Methods inherited from TextDocumentIdentifier
Constructor Details
#initialize(uri:, version:) ⇒ VersionedTextDocumentIdentifier
Returns a new instance of VersionedTextDocumentIdentifier.
5 6 7 8 9 10 11 |
# File 'lib/language_server/protocol/interface/versioned_text_document_identifier.rb', line 5 def initialize(uri:, version:) @attributes = {} @attributes[:version] = version @attributes.freeze end |
Instance Attribute Details
#attributes ⇒ Object (readonly)
Returns the value of attribute attributes.
25 26 27 |
# File 'lib/language_server/protocol/interface/versioned_text_document_identifier.rb', line 25 def attributes @attributes end |
Instance Method Details
#to_hash ⇒ Object
27 28 29 |
# File 'lib/language_server/protocol/interface/versioned_text_document_identifier.rb', line 27 def to_hash attributes end |
#to_json(*args) ⇒ Object
31 32 33 |
# File 'lib/language_server/protocol/interface/versioned_text_document_identifier.rb', line 31 def to_json(*args) to_hash.to_json(*args) end |
#version ⇒ number
The version number of this document. If a versioned text document identifier is sent from the server to the client and the file is not open in the editor (the server has not received an open notification before) the server can send null to indicate that the version is known and the content on disk is the truth (as speced with document content ownership)
21 22 23 |
# File 'lib/language_server/protocol/interface/versioned_text_document_identifier.rb', line 21 def version attributes.fetch(:version) end |