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.1.84 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.83 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.82 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.81 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.80 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.79 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.78 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.77 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.76 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.75 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.74 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.73 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.72 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.71 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.70 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.69 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.68 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.67 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.66 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.65 vendor/bundle/ruby/3.2.0/gems/language_server-protocol-3.17.0.3/lib/language_server/protocol/interface/parameter_information.rb