Sha256: 35e16c262a29db77410beeb40414d26876e113f32007ca4029e8a6fc69ff0473

Contents?: true

Size: 1.13 KB

Versions: 2

Compression:

Stored size: 1.13 KB

Contents

module LanguageServer
  module Protocol
    module Interface
      class VersionedTextDocumentIdentifier < TextDocumentIdentifier
        def initialize(uri:, version:)
          @attributes = {}

          @attributes[:version] = version

          @attributes.freeze
        end

        #
        # 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).
        #
        # The version number of a document will increase after each change, including
        # undo/redo. The number doesn't need to be consecutive.
        #
        # @return [number]
        def version
          attributes.fetch(:version)
        end

        attr_reader :attributes

        def to_hash
          attributes
        end

        def to_json(*args)
          to_hash.to_json(*args)
        end
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
language_server-protocol-3.14.0.1 lib/language_server/protocol/interface/versioned_text_document_identifier.rb
language_server-protocol-3.14.0.0 lib/language_server/protocol/interface/versioned_text_document_identifier.rb