Skip to content

Fix hang in signature help due to loop in findPrecedingMatchingToken - #65006

Merged
Ryan Cavanaugh (RyanCavanaugh) merged 3 commits into
microsoft:mainfrom
RyanCavanaugh:fixSignatureHelpHang
Oct 29, 2026
Merged

Ryan Cavanaugh (RyanCavanaugh) merged 3 commits into
microsoft:mainfrom
RyanCavanaugh:fixSignatureHelpHang

Conversation

@RyanCavanaugh

Copy link
Copy Markdown
Member

Found this while measuring LSP perf. This doesn't seem to happen in VS Code etc due to automatic paren insertion, but definitely hangs a straight-line edit sequence.

Copilot AI balanced review requested due to automatic review settings October 29, 2026 05:36
@github-project-automation github-project-automation Bot moved this to Not started in PR Backlog Oct 29, 2026
@typescript-automation typescript-automation Bot added Author: Team For Uncommitted Bug PR for untriaged, rejected, closed or missing bug labels Oct 29, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Approval recommended

No active review issues remain for the signature-help token-search fix and its regression test.

No open issues 🎉

What changed in this PR

Fixes a language-server signature-help hang by limiting token searches to text before the current token, preventing the search from moving forward and looping.

Changes:

  • Restricts both delimiter searches in findPrecedingMatchingToken to preceding text.
  • Adds a fourslash regression test verifying that incomplete syntax returns no signature help without hanging.
File Description
tsc/​internal/​ls/​utilities.go Bounds the token-search fast path to preceding text.
tsc/​internal/​fourslash/​tests/​signatureHelpUnclosedParen_test.go Adds regression coverage for the signature-help hang.

Review effort: Balanced

@github-project-automation github-project-automation Bot moved this from Not started to Needs merge in PR Backlog Oct 29, 2026
Merged via the queue into microsoft:main with commit bdec15a Oct 29, 2026
29 checks passed
@RyanCavanaugh
Ryan Cavanaugh (RyanCavanaugh) deleted the fixSignatureHelpHang branch October 29, 2026 06:20
@github-project-automation github-project-automation Bot moved this from Needs merge to Done in PR Backlog Oct 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Author: Team For Uncommitted Bug PR for untriaged, rejected, closed or missing bug

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants