-
Notifications
You must be signed in to change notification settings - Fork 12.9k
Closed
Labels
Domain: Completion ListsThe issue relates to showing completion lists in an editorThe issue relates to showing completion lists in an editorExperience EnhancementNoncontroversial enhancementsNoncontroversial enhancementsFix AvailableA PR has been opened for this issueA PR has been opened for this issueHelp WantedYou can do thisYou can do thisSuggestionAn idea for TypeScriptAn idea for TypeScript
Milestone
Description
Does this issue occur when all extensions are disabled?: Yes
- VS Code Version: 1.76.0
- OS Version: Windows 11 22H2 (22621.1265)
Steps to Reproduce:
- Using the following object union type:
type TestType = {
key1: 'a',
key2: '1',
} | {
key1: 'a',
key2: '2',
} | {
key1: 'b',
key2: '3',
}
- Even though
key2: '1' | '2'
when key1 is 'a', VSCode suggest 1, 2 and 3 as b values:
The underlying type checker even knows the correct values for key2, and throws a problem if theyre used: (note thekey2: "1" | "2"
part)
This causes bigger usability problems when used with larger unions and objects where VSCode spills the suggestions with lots of incorrect ones.
sergiidiak and SlurpTheo
Metadata
Metadata
Assignees
Labels
Domain: Completion ListsThe issue relates to showing completion lists in an editorThe issue relates to showing completion lists in an editorExperience EnhancementNoncontroversial enhancementsNoncontroversial enhancementsFix AvailableA PR has been opened for this issueA PR has been opened for this issueHelp WantedYou can do thisYou can do thisSuggestionAn idea for TypeScriptAn idea for TypeScript