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

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

Overview

Registration options for a [SignatureHelpRequest](#SignatureHelpRequest).

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

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

Returns a new instance of SignatureHelpRegistrationOptions.



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

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

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

#attributesObject (readonly)

Returns the value of attribute attributes.



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

def attributes
  @attributes
end

Instance Method Details

#document_selectorDocumentSelector | null

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 | null)


24
25
26
# File 'lib/language_server/protocol/interface/signature_help_registration_options.rb', line 24

def document_selector
  attributes.fetch(:documentSelector)
end

#retrigger_charactersstring[] | nil

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

Since:

  • 3.15.0



45
46
47
# File 'lib/language_server/protocol/interface/signature_help_registration_options.rb', line 45

def retrigger_characters
  attributes.fetch(:retriggerCharacters)
end

#to_hashObject



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

def to_hash
  attributes
end

#to_json(*args) ⇒ Object



60
61
62
# File 'lib/language_server/protocol/interface/signature_help_registration_options.rb', line 60

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

#trigger_charactersstring[] | nil

List of characters that trigger signature help automatically.

Returns:

  • (string[] | nil)


32
33
34
# File 'lib/language_server/protocol/interface/signature_help_registration_options.rb', line 32

def trigger_characters
  attributes.fetch(:triggerCharacters)
end

#work_done_progressboolean | nil

Returns:

  • (boolean | nil)


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

def work_done_progress
  attributes.fetch(:workDoneProgress)
end