Class: LanguageServer::Protocol::Interface::SignatureHelpOptions

Inherits:
Object
  • Object
show all
Defined in:
lib/language_server/protocol/interface/signature_help_options.rb,
sig/language_server/protocol/interface/signature_help_options.rbs

Overview

Server Capabilities for a SignatureHelpRequest.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(trigger_characters: nil, retrigger_characters: nil, work_done_progress: nil) ⇒ SignatureHelpOptions

Returns a new instance of SignatureHelpOptions.

Parameters:

  • trigger_characters: (Array[String]) (defaults to: nil)
  • retrigger_characters: (Array[String]) (defaults to: nil)
  • work_done_progress: (Boolean) (defaults to: nil)


8
9
10
11
12
13
14
15
16
# File 'lib/language_server/protocol/interface/signature_help_options.rb', line 8

def initialize(trigger_characters: nil, retrigger_characters: nil, work_done_progress: nil)
  @attributes = {}

  @attributes[:triggerCharacters] = trigger_characters if trigger_characters
  @attributes[:retriggerCharacters] = retrigger_characters if retrigger_characters
  @attributes[:workDoneProgress] = work_done_progress if work_done_progress

  @attributes.freeze
end

Instance Attribute Details

#attributesHash[Symbol, untyped] (readonly)

Returns the value of attribute attributes.

Returns:

  • (Hash[Symbol, untyped])


44
45
46
# File 'lib/language_server/protocol/interface/signature_help_options.rb', line 44

def attributes
  @attributes
end

Instance Method Details

#retrigger_charactersstring[]

List of characters that re-trigger signature help.

These trigger characters are only active when signature help is already showing. All trigger characters are also counted as re-trigger characters.

Returns:

  • (string[])

Since:

  • 3.15.0



35
36
37
# File 'lib/language_server/protocol/interface/signature_help_options.rb', line 35

def retrigger_characters
  attributes.fetch(:retriggerCharacters)
end

#to_hashHash[Symbol, untyped]

Returns:

  • (Hash[Symbol, untyped])


46
47
48
# File 'lib/language_server/protocol/interface/signature_help_options.rb', line 46

def to_hash
  attributes
end

#to_json(*args) ⇒ String

Parameters:

  • (Object)

Returns:

  • (String)


50
51
52
# File 'lib/language_server/protocol/interface/signature_help_options.rb', line 50

def to_json(*args)
  to_hash.to_json(*args)
end

#trigger_charactersstring[]

List of characters that trigger signature help automatically.

Returns:

  • (string[])


22
23
24
# File 'lib/language_server/protocol/interface/signature_help_options.rb', line 22

def trigger_characters
  attributes.fetch(:triggerCharacters)
end

#work_done_progressboolean

Returns:

  • (boolean)


40
41
42
# File 'lib/language_server/protocol/interface/signature_help_options.rb', line 40

def work_done_progress
  attributes.fetch(:workDoneProgress)
end