Sha256: 06052b19e2ce1ba19e26665d91304e356948c3d38668e3eb380dc003116d25e4

Contents?: true

Size: 801 Bytes

Versions: 3

Compression:

Stored size: 801 Bytes

Contents

module LanguageServer
  module Protocol
    module Interface
      class CompletionParams < TextDocumentPositionParams
        def initialize(text_document:, position:, context: nil)
          @attributes = {}

          @attributes[:context] = context if context

          @attributes.freeze
        end

        #
        # The completion context. This is only available if the client specifies
        # to send this using `ClientCapabilities.textDocument.completion.contextSupport === true`
        #
        # @return [CompletionContext]
        def context
          attributes.fetch(:context)
        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.1 lib/language_server/protocol/interface/completion_params.rb
language_server-protocol-3.14.0.0 lib/language_server/protocol/interface/completion_params.rb
language_server-protocol-3.12.0.0 lib/language_server/protocol/interface/completion_params.rb