Skip to content

Trigger signature help after function completion - #1878

Merged
renkun-ken merged 1 commit into
mainfrom
codex/trigger-signature-help-after-completion
Oct 17, 2026
Merged

renkun-ken merged 1 commit into
mainfrom
codex/trigger-signature-help-after-completion

Conversation

@renkun-ken

@renkun-ken renkun-ken commented Oct 16, 2026 •

Copy link
Copy Markdown
Member

Accepting a function completion such as fun1 inserts fun1() but previously left parameter hints closed because snippet insertion does not fire signature-help trigger characters. Add completion middleware that runs VS Code's parameter-hints command after accepting function, method, or constructor snippets that place the cursor inside the call.

The middleware respects the document's editor.parameterHints.enabled setting and preserves existing completion commands. The behavior is implemented entirely in vscode-R and works with the existing languageserver snippets.

Automatically opening signature help after completion is an established editor integration pattern. The implementation location varies:

Implementation Practice
VS Code TypeScript support Adds editor.action.triggerParameterHints on the client for function-call snippets with parameters, respecting the parameter-hints setting.
Go / gopls VS Code extension Adds the same command in completion middleware for function and method items, respecting the document's parameter-hints setting.
clangd VS Code extension Adds the command in client middleware when a snippet enters an argument placeholder, preserving existing commands.
rust-analyzer Supplies a server-side command when the client advertises support, and can defer it until completion-item resolution.

LSP allows a command to run after completion insertion, but the parameter-hints command is editor-specific. This PR follows Go and clangd by keeping that behavior in VS Code's completion middleware. This avoids adding a command to every eligible item in the server's initial completion response and keeps editor settings in the client; the selected item's command can still round-trip during completion resolution.

Validation:

  • pnpm run pretest
  • pnpm run typecheck
  • pnpm run lint
  • Seven focused tests passed in VS Code 1.141.1, including actual completion acceptance through an in-memory LSP server with parameter hints enabled and disabled. Coverage also includes completion-list metadata, cancellation, text-edit conversion, and command preservation through completion resolution.
  • git diff --check origin/main...HEAD

@renkun-ken
renkun-ken requested a review from eitsupi October 16, 2026 06:24
@renkun-ken

Copy link
Copy Markdown
Member Author

@eitsupi Would you like to review this PR?

@eitsupi

eitsupi commented Oct 17, 2026

Copy link
Copy Markdown
Member

I'm sorry, I didn't notice. I'll take a look.

@renkun-ken
renkun-ken merged commit f41b947 into main Oct 17, 2026
5 checks passed
@renkun-ken
renkun-ken deleted the codex/trigger-signature-help-after-completion branch October 17, 2026 04:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants