class LanguageServer::Protocol::Interface::ParameterInformation

Represents a parameter of a callable-signature. A parameter can have a label and a doc-comment.

Attributes

attributes[R]

Public Class Methods

new(label:, documentation: nil) click to toggle source
# File lib/language_server/protocol/interface/parameter_information.rb, line 9
def initialize(label:, documentation: nil)
  @attributes = {}

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

  @attributes.freeze
end

Public Instance Methods

documentation() click to toggle source

The human-readable doc-comment of this parameter. Will be shown in the UI but can be omitted.

@return [string | MarkupContent]

# File lib/language_server/protocol/interface/parameter_information.rb, line 40
def documentation
  attributes.fetch(:documentation)
end
label() click to toggle source

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]]

# File lib/language_server/protocol/interface/parameter_information.rb, line 31
def label
  attributes.fetch(:label)
end
to_hash() click to toggle source
# File lib/language_server/protocol/interface/parameter_information.rb, line 46
def to_hash
  attributes
end
to_json(*args) click to toggle source
# File lib/language_server/protocol/interface/parameter_information.rb, line 50
def to_json(*args)
  to_hash.to_json(*args)
end