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

Inherits:
WorkDoneProgressOptions show all
Defined in:
lib/language_server/protocol/interface/signature_help_options.rb

Direct Known Subclasses

SignatureHelpRegistrationOptions

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from WorkDoneProgressOptions

#work_done_progress

Constructor Details

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

Returns a new instance of SignatureHelpOptions.



5
6
7
8
9
10
11
12
13
# File 'lib/language_server/protocol/interface/signature_help_options.rb', line 5

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

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

  @attributes.freeze
end

Instance Attribute Details

#attributesObject (readonly)

Returns the value of attribute attributes.



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

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


31
32
33
# File 'lib/language_server/protocol/interface/signature_help_options.rb', line 31

def retrigger_characters
  attributes.fetch(:retriggerCharacters)
end

#to_hashObject



37
38
39
# File 'lib/language_server/protocol/interface/signature_help_options.rb', line 37

def to_hash
  attributes
end

#to_json(*args) ⇒ Object



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

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

#trigger_charactersstring[]

The characters that trigger signature help automatically.

Returns:

  • (string[])


20
21
22
# File 'lib/language_server/protocol/interface/signature_help_options.rb', line 20

def trigger_characters
  attributes.fetch(:triggerCharacters)
end