-
Notifications
You must be signed in to change notification settings - Fork 12.8k
Methods are not new identifier definition locations #42595
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
Comments
let x = {
addEventListener
} It was added in #41539. Edit: everything else I said was based on a misunderstanding of what “new identifier location” was supposed to do |
|
There's 2 things:
The latter should permit people to write out a new name without a commit character committing to an arbitrary global or local. |
That "often" has more to do with a contextual type. If you have a contextual type, you probably just want to provide those completions. |
It sounds like there's another bug here which is that The idea is that there's 3 states I have in mind
And I'm saying we want the third one. |
Got it, I thought you were talking about (2) but you were talking about (3). |
If an object literal has a contextual type, are its members still new identifier definition locations? That function currently works off syntax alone. Edit: actually, it pretty much Just Works— function f2<T extends { xyz: number }>(x: T) {}
f2({ x/*2*/ }); Here, we offer exactly one completion, |
Yeah that doesn't seem too bad I suppose. |
Type in
a(
and we'll auto-complete the property. That shouldn't happen.The text was updated successfully, but these errors were encountered: