-
Notifications
You must be signed in to change notification settings - Fork 12.8k
Fix completions of optional properties in generic positions #33937
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
Conversation
Awesome! Would be great to see this merged! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One test idea plus some nits.
@andrewbranch this also fixes #28470 |
Ugh, committing PR review suggestions from GitHub UI doesn’t work in checker.ts 😑 |
🎉 |
Very excited to see this merged 🙏 This example should now work in VSCode and show interface MyOptions {
hello?: boolean
world?: boolean
}
declare function bar<T extends MyOptions>(options?: Partial<T>): void
bar({
hello: true,
/* cursor */
}) @andrewbranch can you confirm that this example is now working for you? |
I added a small PR to add exactly that test case, as it's important for us at Prisma that this one works. |
@timsuchanek yep, that example works in VS Code for me:
If you’re building the source from master, you want to set the path to |
Awesome. I didn't know about the |
Builds on #32100
Fixes #30507
Fixes #28470
Notable changes from #32100:
you get completions for both
x
anda
. Thanks to @DanielRosenwasser for that suggestion.