Sha256: 46fdbd98e454ddbd36dc001dff93a057f97850e21d1db8d57c165571d8d86264

Contents?: true

Size: 1.05 KB

Versions: 5

Compression:

Stored size: 1.05 KB

Contents

module LanguageServer
  module Protocol
    module Interface
      class ColorPresentationParams
        def initialize(text_document:, color:, range:)
          @attributes = {}

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

          @attributes.freeze
        end

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

        #
        # The color information to request presentations for.
        #
        # @return [Color]
        def color
          attributes.fetch(:color)
        end

        #
        # The range where the color would be inserted. Serves as a context.
        #
        # @return [Range]
        def range
          attributes.fetch(:range)
        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

5 entries across 5 versions & 1 rubygems

Version Path
language_server-protocol-3.14.0.2 lib/language_server/protocol/interface/color_presentation_params.rb
language_server-protocol-3.14.0.1 lib/language_server/protocol/interface/color_presentation_params.rb
language_server-protocol-3.14.0.0 lib/language_server/protocol/interface/color_presentation_params.rb
language_server-protocol-3.12.0.0 lib/language_server/protocol/interface/color_presentation_params.rb
language_server-protocol-3.7.0.0 lib/language_server/protocol/interface/color_presentation_params.rb