Sha256: 21ba7ccda516eaf805a3ea8981c5628ea663aaffc61095f3ac6b0105cb902304

Contents?: true

Size: 1.65 KB

Versions: 107

Compression:

Stored size: 1.65 KB

Contents

module LanguageServer
  module Protocol
    module Interface
      class ReferenceParams
        def initialize(text_document:, position:, work_done_token: nil, partial_result_token: nil, context:)
          @attributes = {}

          @attributes[:textDocument] = text_document
          @attributes[:position] = position
          @attributes[:workDoneToken] = work_done_token if work_done_token
          @attributes[:partialResultToken] = partial_result_token if partial_result_token
          @attributes[:context] = context

          @attributes.freeze
        end

        #
        # The text document.
        #
        # @return [TextDocumentIdentifier]
        def text_document
          attributes.fetch(:textDocument)
        end

        #
        # The position inside the text document.
        #
        # @return [Position]
        def position
          attributes.fetch(:position)
        end

        #
        # An optional token that a server can use to report work done progress.
        #
        # @return [ProgressToken]
        def work_done_token
          attributes.fetch(:workDoneToken)
        end

        #
        # An optional token that a server can use to report partial results (e.g.
        # streaming) to the client.
        #
        # @return [ProgressToken]
        def partial_result_token
          attributes.fetch(:partialResultToken)
        end

        # @return [ReferenceContext]
        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

107 entries across 107 versions & 13 rubygems

Version Path
fablicop-1.10.3 vendor/bundle/ruby/3.2.0/gems/language_server-protocol-3.17.0.3/lib/language_server/protocol/interface/reference_params.rb
language_server-protocol-3.17.0.3 lib/language_server/protocol/interface/reference_params.rb
language_server-protocol-3.17.0.2 lib/language_server/protocol/interface/reference_params.rb
language_server-protocol-3.17.0.1 lib/language_server/protocol/interface/reference_params.rb
language_server-protocol-3.16.0.3 lib/language_server/protocol/interface/reference_params.rb
language_server-protocol-3.16.0.2 lib/language_server/protocol/interface/reference_params.rb
language_server-protocol-3.16.0.1 lib/language_server/protocol/interface/reference_params.rb