Sha256: 00fe6af45918b9c96428b825de6adf04e81946a9a31443d4060983d0277f504f

Contents?: true

Size: 1.21 KB

Versions: 3

Compression:

Stored size: 1.21 KB

Contents

module LanguageServer
  module Protocol
    module Interface
      class DidChangeTextDocumentParams
        def initialize(text_document:, content_changes:)
          @attributes = {}

          @attributes[:textDocument] = text_document
          @attributes[:contentChanges] = content_changes

          @attributes.freeze
        end

        #
        # The document that did change. The version number points
        # to the version after all provided content changes have
        # been applied.
        #
        # @return [VersionedTextDocumentIdentifier]
        def text_document
          attributes.fetch(:textDocument)
        end

        #
        # The actual content changes. The content changes describe single state changes
        # to the document. So if there are two content changes c1 and c2 for a document
        # in state S then c1 move the document to S' and c2 to S''.
        #
        # @return [TextDocumentContentChangeEvent[]]
        def content_changes
          attributes.fetch(:contentChanges)
        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

3 entries across 3 versions & 1 rubygems

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