Class: LSP::ParameterInformation

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

Overview

export interface ParameterInformation

/**
 * 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`.
 */
label: string | [number, number];
/**
 * The human-readable doc-comment of this signature. Will be shown
 * in the UI but can be omitted.
 */
documentation?: string | MarkupContent;

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from LSPBase

#to_h, #to_json

Constructor Details

#initialize(initial_hash = nil) ⇒ ParameterInformation

Returns a new instance of ParameterInformation.



955
956
957
958
# File 'lib/lsp/lsp_types.rb', line 955

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

Instance Attribute Details

#documentationObject

type: string | [number, number] # type: string | MarkupContent



953
954
955
# File 'lib/lsp/lsp_types.rb', line 953

def documentation
  @documentation
end

#labelObject

type: string | [number, number] # type: string | MarkupContent



953
954
955
# File 'lib/lsp/lsp_types.rb', line 953

def label
  @label
end

Instance Method Details

#from_h!(value) ⇒ Object



960
961
962
963
964
965
# File 'lib/lsp/lsp_types.rb', line 960

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