Skip to content

Fix completions inside tuple types suggesting value symbols - #64146

Open
luo2430 wants to merge 2 commits into
microsoft:mainfrom
luo2430:fix/completions
Open

Fix completions inside tuple types suggesting value symbols#64146
luo2430 wants to merge 2 commits into
microsoft:mainfrom
luo2430:fix/completions

Conversation

@luo2430

@luo2430 luo2430 commented Sep 3, 2026

Copy link
Copy Markdown

Fixes #

#64145

Copilot AI balanced review requested due to automatic review settings September 3, 2026 14:00
@github-project-automation github-project-automation Bot moved this to Not started in PR Backlog Sep 3, 2026
@typescript-automation typescript-automation Bot added the For Uncommitted Bug PR for untriaged, rejected, closed or missing bug label Sep 3, 2026
@typescript-automation

Copy link
Copy Markdown

This PR doesn't have any linked issues. Please open an issue that references this PR. From there we can discuss and prioritise.

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

The focused fix addresses both reported cursor positions and includes appropriate regression coverage.

Pull request overview

Fixes tuple-type completions so only type-compatible symbols are suggested.

Changes:

  • Classifies [ and , within tuple types as type-only locations.
  • Adds fourslash coverage for empty and trailing-comma tuple positions.
File summaries
File Description
tsc/internal/ls/completions.go Corrects tuple completion context detection.
tsc/internal/fourslash/tests/completionsInEmptyTupleType_test.go Verifies type symbols appear and value-only symbols do not.
Review details
  • Files reviewed: 2/2 changed files
  • Comments generated: 0
  • Review effort level: Balanced

💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.

defer testutil.RecoverAndFail(t, "Panic on fourslash test")
const content = `type UserTuple = [["name", string], ["age", number], ["address", string]];
type AdminTuple = [/*1*/];
type OtherTuple = [string, /*2*/];

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Might also want to test type QueryTuple = [typeof /*3*/];

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

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

The targeted fix matches the reported behavior and includes focused positive and negative regression coverage.

Review details
  • Files reviewed: 2/2 changed files
  • Comments generated: 0 new
  • Review effort level: Balanced

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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

Projects

Status: Not started

Development

Successfully merging this pull request may close these issues.

3 participants