Sha256: 31858795bf2c02f648a86c8cedf5766237289e7faa5bed0adda3a2a93c15760b

Contents?: true

Size: 1.07 KB

Versions: 7

Compression:

Stored size: 1.07 KB

Contents

module LanguageServer
  module Protocol
    module Interfaces
      #
      # Params for the CodeActionRequest
      #
      class CodeActionParams
        def initialize(text_document:, range:, context:)
          @attributes = {}

          @attributes[:textDocument] = text_document
          @attributes[:range] = range
          @attributes[:context] = context

          @attributes.freeze
        end

        #
        # The document in which the command was invoked.
        #
        # @return [TextDocumentIdentifier]
        def text_document
          attributes.fetch(:textDocument)
        end

        #
        # The range for which the command was invoked.
        #
        # @return [Range]
        def range
          attributes.fetch(:range)
        end

        #
        # Context carrying additional information.
        #
        # @return [CodeActionContext]
        def context
          attributes.fetch(:context)
        end

        attr_reader :attributes

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

Version data entries

7 entries across 7 versions & 2 rubygems

Version Path
language_server-protocol-0.2.0 lib/language_server/protocol/interfaces/code_action_params.rb
language_server-protocol-0.1.0 lib/language_server/protocol/interfaces/code_action_params.rb
language_server-0.4.0 lib/language_server/protocol/interfaces/code_action_params.rb
language_server-0.3.1 lib/language_server/protocol/interfaces/code_action_params.rb
language_server-0.3.0 lib/language_server/protocol/interfaces/code_action_params.rb
language_server-0.2.0 lib/language_server/protocol/interfaces/code_action_params.rb
language_server-0.1.0 lib/language_server/protocol/interfaces/code_action_params.rb