Class: LanguageServer::Protocol::Interface::OptionalVersionedTextDocumentIdentifier
- Inherits:
-
Object
- Object
- LanguageServer::Protocol::Interface::OptionalVersionedTextDocumentIdentifier
- Defined in:
- lib/language_server/protocol/interface/optional_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:) ⇒ OptionalVersionedTextDocumentIdentifier
constructor
A new instance of OptionalVersionedTextDocumentIdentifier.
- #to_hash ⇒ Object
- #to_json(*args) ⇒ Object
-
#uri ⇒ string
The text document’s URI.
-
#version ⇒ number
The version number of this document.
Constructor Details
#initialize(uri:, version:) ⇒ OptionalVersionedTextDocumentIdentifier
Returns a new instance of OptionalVersionedTextDocumentIdentifier.
5 6 7 8 9 10 11 12 |
# File 'lib/language_server/protocol/interface/optional_versioned_text_document_identifier.rb', line 5 def initialize(uri:, version:) @attributes = {} @attributes[:uri] = uri @attributes[:version] = version @attributes.freeze end |
Instance Attribute Details
#attributes ⇒ Object (readonly)
Returns the value of attribute attributes.
38 39 40 |
# File 'lib/language_server/protocol/interface/optional_versioned_text_document_identifier.rb', line 38 def attributes @attributes end |
Instance Method Details
#to_hash ⇒ Object
40 41 42 |
# File 'lib/language_server/protocol/interface/optional_versioned_text_document_identifier.rb', line 40 def to_hash attributes end |
#to_json(*args) ⇒ Object
44 45 46 |
# File 'lib/language_server/protocol/interface/optional_versioned_text_document_identifier.rb', line 44 def to_json(*args) to_hash.to_json(*args) end |
#uri ⇒ string
The text document’s URI.
18 19 20 |
# File 'lib/language_server/protocol/interface/optional_versioned_text_document_identifier.rb', line 18 def uri attributes.fetch(:uri) end |
#version ⇒ number
The version number of this document. If an optional 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 master (as specified with document content ownership).
The version number of a document will increase after each change, including undo/redo. The number doesn’t need to be consecutive.
34 35 36 |
# File 'lib/language_server/protocol/interface/optional_versioned_text_document_identifier.rb', line 34 def version attributes.fetch(:version) end |