class LanguageServer::Protocol::Interface::SignatureHelp

Signature help represents the signature of something callable. There can be multiple signature but only one active and only one active parameter.

Attributes

attributes[R]

Public Class Methods

new(signatures:, active_signature: nil, active_parameter: nil) click to toggle source
# File lib/language_server/protocol/interface/signature_help.rb, line 10
def initialize(signatures:, active_signature: nil, active_parameter: nil)
  @attributes = {}

  @attributes[:signatures] = signatures
  @attributes[:activeSignature] = active_signature if active_signature
  @attributes[:activeParameter] = active_parameter if active_parameter

  @attributes.freeze
end

Public Instance Methods

active_parameter() click to toggle source

The active parameter of the active signature. If omitted or the value lies outside the range of `signatures.parameters` defaults to 0 if the active signature has parameters. If the active signature has no parameters it is ignored. In future version of the protocol this property might become mandatory to better express the active parameter if the active signature does have any.

@return [number]

# File lib/language_server/protocol/interface/signature_help.rb, line 55
def active_parameter
  attributes.fetch(:activeParameter)
end
active_signature() click to toggle source

The active signature. If omitted or the value lies outside the range of `signatures` the value defaults to zero or is ignored if the `SignatureHelp` has no signatures.

Whenever possible implementors should make an active decision about the active signature and shouldn't rely on a default value.

In future version of the protocol this property might become mandatory to better express this.

@return [number]

# File lib/language_server/protocol/interface/signature_help.rb, line 41
def active_signature
  attributes.fetch(:activeSignature)
end
signatures() click to toggle source

One or more signatures. If no signatures are available the signature help request should return `null`.

@return [SignatureInformation

# File lib/language_server/protocol/interface/signature_help.rb, line 25
def signatures
  attributes.fetch(:signatures)
end
to_hash() click to toggle source
# File lib/language_server/protocol/interface/signature_help.rb, line 61
def to_hash
  attributes
end
to_json(*args) click to toggle source
# File lib/language_server/protocol/interface/signature_help.rb, line 65
def to_json(*args)
  to_hash.to_json(*args)
end