1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
//! Active signature-help popup state.
//!
//! Lives on `App` for the same reason `CompletionState` does: the popup
//! is non-modal — the user keeps typing in insert mode while it's open
//! and the help just updates in place after each keystroke.
//!
//! Lifecycle:
//! 1. User types a server-declared trigger character (typically `(`) or
//! `accept_completion` auto-appends `()` after a callable item.
//! `App::lsp_signature_help` fires `textDocument/signatureHelp`,
//! snapshotting the cursor row as the anchor.
//! 2. The response arrives and `apply_signature_help_outcome` either
//! opens / refreshes the popup or — when the server returns `null` —
//! closes it.
//! 3. While open, every keystroke in `handle_insert_key` re-fires the
//! request as a retrigger (`isRetrigger: true`). The server is
//! responsible for tracking which parameter the cursor is currently
//! in and updating `activeParameter` accordingly.
//! 4. Esc / cursor row change / explicit close drops the state.
use crateSignatureHelp;
/// Active signature-help popup. `None` on `App` when nothing is showing.
/// How a signature-help request was initiated. Maps onto LSP's
/// `SignatureHelpContext` so the server can branch its behavior — most
/// notably, `(` versus `,` typically map to `TriggerCharacter` /
/// `ContentChange` respectively, and accept-completion follow-ups map
/// to `Invoked`.