Bad completions for string literal type as indexed access type object #40322
Labels
Bug
A bug in TypeScript
Domain: Completion Lists
The issue relates to showing completion lists in an editor
Good First Issue
Well scoped, documented and has the green light
Help Wanted
You can do this
Milestone
Found while reading over #39697
Request completions inside of
""
and you'll get the names of every propery onString
. What's happening is that we're not checking to see if the current string literal type is the argument type (as opposed to the object type itself).Learning how this works might be a bit involved, but the fix is easy: add fourslash tests, add a single
if
check atTypeScript/src/services/stringCompletions.ts
Lines 117 to 124 in d75894d
The text was updated successfully, but these errors were encountered: