lsp: Fix vtsls completeFunctionCalls setting being ignored#53285
Merged
smitbarmase merged 2 commits intomainfrom Apr 23, 2026
Merged
lsp: Fix vtsls completeFunctionCalls setting being ignored#53285smitbarmase merged 2 commits intomainfrom
vtsls completeFunctionCalls setting being ignored#53285smitbarmase merged 2 commits intomainfrom
Conversation
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
8a09e09 to
0ce0e66
Compare
yeskunall
commented
Apr 7, 2026
smitbarmase
requested changes
Apr 7, 2026
Member
smitbarmase
left a comment
There was a problem hiding this comment.
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
Completionsince 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
approved these changes
Apr 23, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Some language servers (notably
vtslswithcompleteFunctionCalls) updateinsertText/textEditduringcompletionItem/resolveto add snippet content like function call parentheses. Previously,Completion.new_textwas only set from the initial completion response and never re-derived after resolve, so the snippet text was silently discarded.Re-derive
new_textfrom the resolvedlsp_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:
Closes #53275.
Release Notes:
vtslscompleteFunctionCallssetting being ignored