Some time ago, the suggest-as-you-type became kind of badly behaved. I’ve noticed two problems.
1. It makes a suggestion on NO character input (0 length token).
I realize that this is code, so these are tokens, not words, and spacebar isn’t necessarily the delineator between tokens. But it seems like there are some conditions where a token of length 0 causes the suggestion menu to come up. Here’s a short video. I type the token “function”, then hit space, which should be recognized as the boundary between the token “function” and the next token, which I haven’t started entering yet. But before I start the next token, I get a context menu with #endregion at the top.
https://www.awesomescreenshot.com/video/5797217?key=3aa009b23d13695c4b96ba2b9fb7f041
There is no next token here, and this is a problem because if my intention is to hit to go to the next line, I end up taking the suggestion instead. In this way, I’ve added the first suggestion (#endregion, or whatever suggestion is at the top of the menu) about a million times a day. Then I have to erase it just to hit .
I realize this might be a poor example, because generally you don’t hit after typing the word function. But this behavior is not limited to that specific token. It happens on MANY tokens that you’d normally hit after. For example, if you’re using the fat arrow, inline function/block syntax, it would add some suggestion after the {:
foo((blah) => { <here is where I would normally hit return, but the suggest menu appears and I have to kill it before hitting return> });
It’s so obnoxious that I have trained myself to hit to close the suggestion menu, and then IMMEDIATELY hit before the code complete can pop up the menu again (nanoseconds, it seems, which brings me to problem #2).
2. It makes a suggestion on no NEW character input.
The suggestion menu pops up WAY TOO AGGRESSIVELY/QUICKLY even if you haven’t changed the token being suggested on.
The thing I feel is broken about this is that when you reject with escape, the menu doesn’t stay gone. It comes right back with the same suggestion when I have not typed anything new. I have not changed the token being suggested on, I have said to the editor “No, I don’t want suggestions right now”, but it pops up the suggestor again, before I have changed the token in any way that would indicate to the auto-suggestor that I am ready for a new suggestion. In this way, I have hit escape-enter, only to have the suggestion menu re-appear in literally microseconds and then I hit enter, but end up taking the suggestion that I don’t want to take.
This is, by far, the most irritating thing about the code editor’s auto suggest behavior. More often than not, it prevents me from doing what I want to do instead of helping me do what I want to do. I have to continually shove it out of the way, only to have it reappear right in my face like that overly talkative, but utterly boring friend of yours who never stops talking and won’t get the hint that you’re done talking to them. Even if you walk away from the conversation, they follow you from room to room talking at you anyway until you just want to pop them in the chops and scream “SHUT UP! SHUT UP! YOU BORING MORON!!!” (ask me how many times I’ve said these words to the code editor after the 47th time it’s added some code block for me after I told it to shut up. No…don’t ask me). But even screaming at them doesn’t work, and they continue to follow you around interjecting their boring, irrelevant bloviating when you least want it.
I was going to record this phenomenon for you, but ?maybe? you might be running some experiments, because this morning, I cannot get the obnoxious aggressive behavior to happen. But it has happened MANY MANY MANY times in the recent past. Just not this morning. If you have indeed done some work to recognize token boundaries and reduce the condition where you suggest something on a 0 length token, or on a token that has NOT changed since I rejected the suggestion, please keep it that way ! It’s infinitely better than having to hit escape every single time I want to type another word or hit enter to go to the next line.
Suggestions:
Autosuggest is really helpful in a code editor, but the behavior needs to be controlled so that it doesn’t end up hurting more than it helps.
-
Don’t suggest anything unless the current token actually exists/is more than length 0.
-
Use or or some other key combination that the user is less likely to need to type for another reason (not simply ) to take the suggestion
or
2.a Use enter, but delay the suggestion menu popup so that if someone wants to actually hit enter, they don’t end up getting a last minute suggestion and then taking it.
-
Use to tell the suggestion “I don’t want this suggestion. Please go away.”
-
The suggestor should NOT reappear after #3 unless you have changed the token in some way that indicates you might actually be receptive to another suggestion.
If you have made some improvements, especially around the second problem, good work, and please keep it this way!!!
Cheers
Tracey