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

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

Instance Attribute Summary collapse

Instance Method Summary collapse

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.



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

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


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

def retrigger_characters
  attributes.fetch(:retriggerCharacters)
end

#to_hashObject



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

def to_hash
  attributes
end

#to_json(*args) ⇒ Object



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

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

#trigger_charactersstring[]

The characters that trigger signature help automatically.

Returns:

  • (string[])


25
26
27
# File 'lib/language_server/protocol/interface/signature_help_options.rb', line 25

def trigger_characters
  attributes.fetch(:triggerCharacters)
end

#work_done_progressboolean

Returns:

  • (boolean)


16
17
18
# File 'lib/language_server/protocol/interface/signature_help_options.rb', line 16

def work_done_progress
  attributes.fetch(:workDoneProgress)
end