-
Notifications
You must be signed in to change notification settings - Fork 13.1k
Don't show the currently-completing thing at the cursor in JS files #6707
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
|
nice 😉 |
|
👍 |
1 similar comment
|
👍 |
|
Investigating test failure... |
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.
Isn't this too order-dependent? What happens if you add code prior to another usage? For instance, I start out with:
if (Person.blah) {
doSomething();
}I'd want to also get completion for if I added a use of Person.blah before the if statement:
Person.blah/**/
if (Person.blah) {
doSomething();
}
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.
If you have multiple uses, the value in the table becomes -1 and no filtering occurs
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.
Ah, okay. I misunderstood.
Why don't you use an enum that would make this explicit?
const name = (node as Identifier).text;
nameTable[name] = hasProperty(nameTable, name) ? NameTableState.Once : NameTableState.Many;or at the very least, leave a nice big comment explaining what you're doing here and what -1 means.
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.
Because we need the position in the case where it's Once.
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.
Ah, right. You're not checking the current identifier and asking "should I actually show this", you're just grabbing up identifiers. I'm not sure why I missed that.
Don't show the currently-completing thing at the cursor in JS files
Fixes #6693