Class: LanguageServer::Protocol::Interface::SignatureHelpRegistrationOptions

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(document_selector:, work_done_progress: nil, trigger_characters: nil, retrigger_characters: nil) ⇒ SignatureHelpRegistrationOptions

Returns a new instance of SignatureHelpRegistrationOptions.



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

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

  @attributes[:documentSelector] = document_selector
  @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.



51
52
53
# File 'lib/language_server/protocol/interface/signature_help_registration_options.rb', line 51

def attributes
  @attributes
end

Instance Method Details

#document_selectorDocumentSelector

A document selector to identify the scope of the registration. If set to null the document selector provided on the client side will be used.

Returns:

  • (DocumentSelector)


21
22
23
# File 'lib/language_server/protocol/interface/signature_help_registration_options.rb', line 21

def document_selector
  attributes.fetch(:documentSelector)
end

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


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

def retrigger_characters
  attributes.fetch(:retriggerCharacters)
end

#to_hashObject



53
54
55
# File 'lib/language_server/protocol/interface/signature_help_registration_options.rb', line 53

def to_hash
  attributes
end

#to_json(*args) ⇒ Object



57
58
59
# File 'lib/language_server/protocol/interface/signature_help_registration_options.rb', line 57

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

#trigger_charactersstring[]

The characters that trigger signature help automatically.

Returns:

  • (string[])


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

def trigger_characters
  attributes.fetch(:triggerCharacters)
end

#work_done_progressboolean

Returns:

  • (boolean)


26
27
28
# File 'lib/language_server/protocol/interface/signature_help_registration_options.rb', line 26

def work_done_progress
  attributes.fetch(:workDoneProgress)
end