Repository navigation
Add compact member tips and optional inline completion details - #857
Conversation
eitsupi
left a comment
There was a problem hiding this comment.
ChatGPT-assisted review:
I found a few points worth addressing or clarifying.
-
Namespace access during completion
In
completion_symbol_info(),ns$get_signature()is called for each matching function candidate. Internally,PackageNamespace$get_signature()retrieves the function usingget(), which may trigger active bindings.This also moves potentially expensive signature retrieval from selected-item resolution to completion-list generation, potentially affecting latency with up to 200 candidates.
Could we avoid evaluating active bindings and benchmark completion latency with a large number of candidates?
-
Change in default inline signature behavior
Previously, function signatures were added to
labelDetailsduring resolution when the client supported them. This PR disables that behavior by default throughcompletion_label_details = FALSE.Is this backward-incompatible change intentional? I agree with making additional inline value/type previews opt-in, but I'm not sure existing signature display should also be disabled.
-
Completion responsiveness
Enabling
completion_label_detailsdisables the lightweightbasic_name_completion_reply()path, potentially delaying completions until parsing finishes.Could we verify the latency impact, particularly during rapid typing or with larger documents?
|
@eitsupi, the follow-up changes address the three review points:
Compared with
These are 20 samples per case on R 4.6.1 / macOS arm64. Namespace preparation is outside the package-case timer; editor rendering, IPC, scheduling, and debounce are excluded. Every fixed rapid-edit request with inline details returned 200 unique candidates and 200 signatures through the lightweight path. The benchmark and full results are reproducible ( The relevant local tests and changed-code lint pass, and all 18 CI checks passed at |
Member completions get short, bounded literal, type and known-field tips. The
completion_label_detailssetting (defaultFALSE) shows inline signatures and tips consistently for members and ordinary symbols when supported by the editor. Selected-item details remain available in compact mode.Bulk package signature lookup inspects stored bindings, skips active bindings and unforced promises, and reuses the signature cache. Inline mode retains the lightweight current-buffer completion path and avoids guessed annotations for conditional, future or masked declarations.
Label annotations are supplied in the initial response and preserved during resolution unless the client explicitly supports resolving
labelDetails. This follows the VS Code API: its resolve capabilities cover documentation, detail and additional edits, while labels must be supplied initially. The compact default is intentional; the previous resolve-only signature annotations were not a dependable visible feature in VS Code.Validation: relevant completion, member, resolve, scope, readiness and settings tests passed; no lint findings in changed code;
git diff --checkpassed.Benchmark: 20 samples per case on R 4.6.1 / macOS arm64, compared with
0720a4f. Warm lookup for 200 package signatures measured 9 → 10 ms median. Rapid-edit completion with inline details measured 74 → 31 ms in a 250-line buffer and 947.5 → 226 ms in a 10,000-line buffer. Every fixed rapid-edit request with inline details returned 200 signatures through the lightweight path. Editor rendering, IPC and debounce are excluded. See methodology and results.