class LanguageServer::Protocol::Interface::OptionalVersionedTextDocumentIdentifier

Attributes

attributes[R]

Public Class Methods

new(uri:, version:) click to toggle source
# 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

Public Instance Methods

to_hash() click to toggle source
# File lib/language_server/protocol/interface/optional_versioned_text_document_identifier.rb, line 40
def to_hash
  attributes
end
to_json(*args) click to toggle source
# 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() click to toggle source

The text document's URI.

@return [string]

# File lib/language_server/protocol/interface/optional_versioned_text_document_identifier.rb, line 18
def uri
  attributes.fetch(:uri)
end
version() click to toggle source

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.

@return [number]

# File lib/language_server/protocol/interface/optional_versioned_text_document_identifier.rb, line 34
def version
  attributes.fetch(:version)
end