Don't show the currently-completing thing at the cursor in JS files#6707
Conversation
|
nice 😉 |
|
👍 |
1 similar comment
|
👍 |
|
Investigating test failure... |
There was a problem hiding this comment.
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.
If you have multiple uses, the value in the table becomes -1 and no filtering occurs
There was a problem hiding this comment.
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.
Because we need the position in the case where it's Once.
There was a problem hiding this comment.
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