Skip to content

lsp: Fix vtsls completeFunctionCalls setting being ignored#53285

Merged
smitbarmase merged 2 commits intomainfrom
fix-issue-53275-e8b3f77104f826b7
Apr 23, 2026
Merged

lsp: Fix vtsls completeFunctionCalls setting being ignored#53285
smitbarmase merged 2 commits intomainfrom
fix-issue-53275-e8b3f77104f826b7

Conversation

@yeskunall
Copy link
Copy Markdown
Member

Some language servers (notably vtsls with completeFunctionCalls) update insertText/textEdit during completionItem/resolve to add snippet content like function call parentheses. Previously, Completion.new_text was only set from the initial completion response and never re-derived after resolve, so the snippet text was silently discarded.

Re-derive new_text from the resolved lsp_completion. Only the text content is updated -- replace/insert ranges are left as anchors from the original response since the LSP ranges in the resolved text_edit are stale when completions are cached across keystrokes (re: #34094).

Self-Review Checklist:

  • I've reviewed my own diff for quality, security, and reliability
  • Unsafe blocks (if any) have justifying comments
  • The content is consistent with the UI/UX checklist
  • Tests cover the new/changed behavior
  • Performance impact has been considered and is acceptable

Closes #53275.

Release Notes:

  • Fixed the vtsls completeFunctionCalls setting being ignored

@cla-bot cla-bot Bot added the cla-signed The user has signed the Contributor License Agreement label Apr 7, 2026
@zed-community-bot zed-community-bot Bot added the staff Pull requests authored by a current member of Zed staff label Apr 7, 2026
Some language servers (notably vtsls with completeFunctionCalls) update
insertText/textEdit during completionItem/resolve to add snippet content
like function call parentheses. Previously, Completion.new_text was only
set from the initial completion response and never re-derived after
resolve, so the snippet text was silently discarded.

Re-derive new_text from the resolved lsp_completion. Only the text
content is updated—replace/insert ranges are left as anchors from the
original response since the LSP ranges in the resolved text_edit are
stale when completions are cached across keystrokes (#34094).

Closes #53275
@yeskunall yeskunall force-pushed the fix-issue-53275-e8b3f77104f826b7 branch from 8a09e09 to 0ce0e66 Compare April 7, 2026 03:57
Comment thread crates/project/src/lsp_store.rs
Copy link
Copy Markdown
Member

@smitbarmase smitbarmase left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good overall. Since this still isn’t LSP-spec-correct, we should probably keep that comment.

// We must not use any data such as sortText, filterText, insertText and textEdit to edit Completion since they are not suppose change during resolve.
// Refer: https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#textDocument_completion

Also, let’s add a comment referencing the underlying resolve request in typescript-language-features#L218 which vtsls simply wraps.

This fix should be treated as a workaround for this specific VSCode TypeScript extension case.

@smitbarmase smitbarmase added this pull request to the merge queue Apr 23, 2026
Merged via the queue into main with commit 96eb051 Apr 23, 2026
30 checks passed
@smitbarmase smitbarmase deleted the fix-issue-53275-e8b3f77104f826b7 branch April 23, 2026 12:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla-signed The user has signed the Contributor License Agreement staff Pull requests authored by a current member of Zed staff

Projects

None yet

Development

Successfully merging this pull request may close these issues.

vtsls setting "completeFunctionCalls" does nothing

3 participants