Skip to content

Trigger parameter hints on accepting a function-like completion item #1802

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

a7medev
Copy link

@a7medev a7medev commented Aug 23, 2025

Description

We're working on implementing signature help in SourceKit-LSP (swiftlang/sourcekit-lsp#2250) and we faced a problem in VS Code where signature help wasn't triggered after accepting a completion item for a function, method, subscript, initializer, or enum case with associated values that would've normally had signature help if the user manually typed the ( after the signature name.

Here's a demo of the issue with a development version of SourceKit-LSP:

before.mp4

To fix this, we added a provideCompletionItem middleware that inspects completion items that might have signature help (functions, methods (includes subscripts), initializers, and enum cases) and injects an editor.action.triggerParameterHints command (if no other command was present). This results in signature help working pretty well with completion as shown in the video below.

after.mp4

Tasks

  • Required tests have been written
  • Documentation has been updated (N/A)
  • Added an entry to CHANGELOG.md if applicable

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.

1 participant