Class: LSP::SignatureInformation

Inherits:
LSPBase
  • Object
show all
Defined in:
lib/lsp/lsp_types.rb

Overview

export interface SignatureInformation

/**
 * The label of this signature. Will be shown in
 * the UI.
 */
label: string;
/**
 * The human-readable doc-comment of this signature. Will be shown
 * in the UI but can be omitted.
 */
documentation?: string | MarkupContent;
/**
 * The parameters of this signature.
 */
parameters?: ParameterInformation[];

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from LSPBase

#to_h, #to_json

Constructor Details

#initialize(initial_hash = nil) ⇒ SignatureInformation

Returns a new instance of SignatureInformation.



987
988
989
990
# File 'lib/lsp/lsp_types.rb', line 987

def initialize(initial_hash = nil)
  super
  @optional_method_names = %i[documentation parameters]
end

Instance Attribute Details

#documentationObject

type: string # type: string | MarkupContent # type: ParameterInformation[]



985
986
987
# File 'lib/lsp/lsp_types.rb', line 985

def documentation
  @documentation
end

#labelObject

type: string # type: string | MarkupContent # type: ParameterInformation[]



985
986
987
# File 'lib/lsp/lsp_types.rb', line 985

def label
  @label
end

#parametersObject

type: string # type: string | MarkupContent # type: ParameterInformation[]



985
986
987
# File 'lib/lsp/lsp_types.rb', line 985

def parameters
  @parameters
end

Instance Method Details

#from_h!(value) ⇒ Object



992
993
994
995
996
997
998
# File 'lib/lsp/lsp_types.rb', line 992

def from_h!(value)
  value = {} if value.nil?
  self.label = value['label']
  self.documentation = value['documentation'] # Unknown type
  self.parameters = to_typed_aray(value['parameters'], ParameterInformation)
  self
end