Skip to content

(TS) Eliminate already-listed cases in switch-case autocomplete dropdown #47873

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

Closed
mk360 opened this issue Feb 12, 2022 · 2 comments
Closed

(TS) Eliminate already-listed cases in switch-case autocomplete dropdown #47873

mk360 opened this issue Feb 12, 2022 · 2 comments
Labels
Duplicate An existing issue was already created

Comments

@mk360
Copy link

mk360 commented Feb 12, 2022

Search terms: switch, switch case, autocomplete, autocomplete switch case

Considering this example:

type MultiplePossibilities = 'a' | 'b' | 'c' | 'd';
let str: MultiplePossibilities;

// ...

switch (str) {
  case 
  break;
  case
}

When filling the first case, I receive a suggestion from the autocompletion with a selection ranging from a to d. Which makes sense, since it's the first case and there's nothing before it. However, if I choose a in my first case and then move onto other cases, the autocompletion dropdown still suggests a.

The problem is that it makes me lose track of what cases need to be covered, especially since the IDE doesn't raise any warning in case (no pun intended) I added a case I already had covered. This can be especially bothersome in a sufficiently big template literal type.

About my IDE

Version: 1.64.2
Date: February 9th, 2022
TS version: 4.5.5
OS: Windows NT_x64, v10.0.19043

@mjbvz mjbvz transferred this issue from microsoft/vscode Feb 14, 2022
@mjbvz mjbvz removed their assignment Feb 14, 2022
@RyanCavanaugh
Copy link
Member

Duplicate #13711

@RyanCavanaugh RyanCavanaugh added the Duplicate An existing issue was already created label Feb 14, 2022
@typescript-bot
Copy link
Collaborator

This issue has been marked as a 'Duplicate' and has seen no recent activity. It has been automatically closed for house-keeping purposes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Duplicate An existing issue was already created
Projects
None yet
Development

No branches or pull requests

4 participants