Sha256: 99c634ef694f6facf336370308b4a9e4e0f445bbef4af57cc498fb09b7d43225

Contents?: true

Size: 1.55 KB

Versions: 108

Compression:

Stored size: 1.55 KB

Contents

module LanguageServer
  module Protocol
    module Interface
      #
      # Represents a parameter of a callable-signature. A parameter can
      # have a label and a doc-comment.
      #
      class ParameterInformation
        def initialize(label:, documentation: nil)
          @attributes = {}

          @attributes[:label] = label
          @attributes[:documentation] = documentation if documentation

          @attributes.freeze
        end

        #
        # The label of this parameter information.
        #
        # Either a string or an inclusive start and exclusive end offsets within
        # its containing signature label. (see SignatureInformation.label). The
        # offsets are based on a UTF-16 string representation as `Position` and
        # `Range` does.
        #
        # *Note*: a label of type string should be a substring of its containing
        # signature label. Its intended use case is to highlight the parameter
        # label part in the `SignatureInformation.label`.
        #
        # @return [string | [number, number]]
        def label
          attributes.fetch(:label)
        end

        #
        # The human-readable doc-comment of this parameter. Will be shown
        # in the UI but can be omitted.
        #
        # @return [string | MarkupContent]
        def documentation
          attributes.fetch(:documentation)
        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

108 entries across 108 versions & 13 rubygems

Version Path
harbr-0.2.5 vendor/bundle/ruby/3.2.0/gems/language_server-protocol-3.17.0.3/lib/language_server/protocol/interface/parameter_information.rb
harbr-0.2.4 vendor/bundle/ruby/3.2.0/gems/language_server-protocol-3.17.0.3/lib/language_server/protocol/interface/parameter_information.rb
harbr-0.2.3 vendor/bundle/ruby/3.2.0/gems/language_server-protocol-3.17.0.3/lib/language_server/protocol/interface/parameter_information.rb
harbr-0.2.2 vendor/bundle/ruby/3.2.0/gems/language_server-protocol-3.17.0.3/lib/language_server/protocol/interface/parameter_information.rb
harbr-0.2.1 vendor/bundle/ruby/3.2.0/gems/language_server-protocol-3.17.0.3/lib/language_server/protocol/interface/parameter_information.rb
harbr-0.2.0 vendor/bundle/ruby/3.2.0/gems/language_server-protocol-3.17.0.3/lib/language_server/protocol/interface/parameter_information.rb
harbr-0.1.99 vendor/bundle/ruby/3.2.0/gems/language_server-protocol-3.17.0.3/lib/language_server/protocol/interface/parameter_information.rb
harbr-0.1.98 vendor/bundle/ruby/3.2.0/gems/language_server-protocol-3.17.0.3/lib/language_server/protocol/interface/parameter_information.rb
harbr-0.1.97 vendor/bundle/ruby/3.2.0/gems/language_server-protocol-3.17.0.3/lib/language_server/protocol/interface/parameter_information.rb
harbr-0.1.96 vendor/bundle/ruby/3.2.0/gems/language_server-protocol-3.17.0.3/lib/language_server/protocol/interface/parameter_information.rb
harbr-0.1.95 vendor/bundle/ruby/3.2.0/gems/language_server-protocol-3.17.0.3/lib/language_server/protocol/interface/parameter_information.rb
harbr-0.1.94 vendor/bundle/ruby/3.2.0/gems/language_server-protocol-3.17.0.3/lib/language_server/protocol/interface/parameter_information.rb
harbr-0.1.93 vendor/bundle/ruby/3.2.0/gems/language_server-protocol-3.17.0.3/lib/language_server/protocol/interface/parameter_information.rb
harbr-0.1.91 vendor/bundle/ruby/3.2.0/gems/language_server-protocol-3.17.0.3/lib/language_server/protocol/interface/parameter_information.rb
harbr-0.1.90 vendor/bundle/ruby/3.2.0/gems/language_server-protocol-3.17.0.3/lib/language_server/protocol/interface/parameter_information.rb
harbr-0.1.89 vendor/bundle/ruby/3.2.0/gems/language_server-protocol-3.17.0.3/lib/language_server/protocol/interface/parameter_information.rb
harbr-0.1.88 vendor/bundle/ruby/3.2.0/gems/language_server-protocol-3.17.0.3/lib/language_server/protocol/interface/parameter_information.rb
harbr-0.1.87 vendor/bundle/ruby/3.2.0/gems/language_server-protocol-3.17.0.3/lib/language_server/protocol/interface/parameter_information.rb
harbr-0.1.86 vendor/bundle/ruby/3.2.0/gems/language_server-protocol-3.17.0.3/lib/language_server/protocol/interface/parameter_information.rb
harbr-0.1.85 vendor/bundle/ruby/3.2.0/gems/language_server-protocol-3.17.0.3/lib/language_server/protocol/interface/parameter_information.rb