Class: LanguageServer::Protocol::Interface::SignatureHelpContext
- Inherits:
-
Object
- Object
- LanguageServer::Protocol::Interface::SignatureHelpContext
- Defined in:
- lib/language_server/protocol/interface/signature_help_context.rb
Overview
Additional information about the context in which a signature help request was triggered.
Instance Attribute Summary collapse
-
#attributes ⇒ Object
readonly
Returns the value of attribute attributes.
Instance Method Summary collapse
-
#active_signature_help ⇒ SignatureHelp
The currently active ‘SignatureHelp`.
-
#initialize(trigger_kind:, trigger_character: nil, is_retrigger:, active_signature_help: nil) ⇒ SignatureHelpContext
constructor
A new instance of SignatureHelpContext.
-
#is_retrigger ⇒ boolean
‘true` if signature help was already showing when it was triggered.
- #to_hash ⇒ Object
- #to_json(*args) ⇒ Object
-
#trigger_character ⇒ string
Character that caused signature help to be triggered.
-
#trigger_kind ⇒ SignatureHelpTriggerKind
Action that caused signature help to be triggered.
Constructor Details
#initialize(trigger_kind:, trigger_character: nil, is_retrigger:, active_signature_help: nil) ⇒ SignatureHelpContext
Returns a new instance of SignatureHelpContext.
9 10 11 12 13 14 15 16 17 18 |
# File 'lib/language_server/protocol/interface/signature_help_context.rb', line 9 def initialize(trigger_kind:, trigger_character: nil, is_retrigger:, active_signature_help: nil) @attributes = {} @attributes[:triggerKind] = trigger_kind @attributes[:triggerCharacter] = trigger_character if trigger_character @attributes[:isRetrigger] = is_retrigger @attributes[:activeSignatureHelp] = active_signature_help if active_signature_help @attributes.freeze end |
Instance Attribute Details
#attributes ⇒ Object (readonly)
Returns the value of attribute attributes.
62 63 64 |
# File 'lib/language_server/protocol/interface/signature_help_context.rb', line 62 def attributes @attributes end |
Instance Method Details
#active_signature_help ⇒ SignatureHelp
The currently active ‘SignatureHelp`.
The ‘activeSignatureHelp` has its `SignatureHelp.activeSignature` field updated based on the user navigating through available signatures.
58 59 60 |
# File 'lib/language_server/protocol/interface/signature_help_context.rb', line 58 def active_signature_help attributes.fetch(:activeSignatureHelp) end |
#is_retrigger ⇒ boolean
‘true` if signature help was already showing when it was triggered.
Retriggers occur when the signature help is already active and can be caused by actions such as typing a trigger character, a cursor move, or document content changes.
47 48 49 |
# File 'lib/language_server/protocol/interface/signature_help_context.rb', line 47 def is_retrigger attributes.fetch(:isRetrigger) end |
#to_hash ⇒ Object
64 65 66 |
# File 'lib/language_server/protocol/interface/signature_help_context.rb', line 64 def to_hash attributes end |
#to_json(*args) ⇒ Object
68 69 70 |
# File 'lib/language_server/protocol/interface/signature_help_context.rb', line 68 def to_json(*args) to_hash.to_json(*args) end |
#trigger_character ⇒ string
Character that caused signature help to be triggered.
This is undefined when triggerKind !== SignatureHelpTriggerKind.TriggerCharacter
35 36 37 |
# File 'lib/language_server/protocol/interface/signature_help_context.rb', line 35 def trigger_character attributes.fetch(:triggerCharacter) end |
#trigger_kind ⇒ SignatureHelpTriggerKind
Action that caused signature help to be triggered.
24 25 26 |
# File 'lib/language_server/protocol/interface/signature_help_context.rb', line 24 def trigger_kind attributes.fetch(:triggerKind) end |