Open natanfudge opened 5 years ago
Yes - that's the designed and documented behaviour, e.g "Select recent suggestions unless further typing selects one, e.g. console.| -> console.log
because log
has been completed recently.")" and "Select suggestions based on previous prefixes that have completed those suggestions, e.g. co -> console
and con -> const
.")". We started this feature with a more sticky variant but good very negative feedback as it would prevent you fro selecting any other suggestion.
E.g. with console
and exception
what would you expected when typing l
, log
or still exception
?
Thanks for the response jrieken.
When typing l
, I would have expected it to complete log
because exception
has already been filtered out. On the other hand, when I type e
It's pretty obvious I want to type exception
again, since exception
starts with e
. Although when I type er
, exception should absolutely not be an option, and error
should again be the dominant suggestion.
Another possible scenario is this: I first type console.
and complete to time
. After this, when I type console.i
, technically time
was not filtered out. Here there are two options: we either give time
priority since it was typed before and not filtered, or we give info
priority since it matches better. Here I could see why you would give info
priority since it's a stretch to say that when I type i
I mean to type time
.
Although, in the example I showed (with the error/exception), exception
is a very good match, and so should definitely should still be suggested, and not error
.
So to sum up my opinion:
e->exception
) the suggestion should definitely keep suggestion the same thing (exception
in the example).l->exception
) the suggestion should definitely be ignored (so complete to log).
i->time
), suggesting time
is debatable, and I'm leaning towards yes, but I can see why that would seem like "you can't type anything else".Ok, that's kind of what it does today "Select recent suggestions unless further typing selects one". The thing is that e
and error
or e
and exception
score equally well and that then the original order (alphabetical) is used to make a decision. I can check if we can use the history instead.
VSCode has a feature that remembers recent completions the user has selected and then automatically choosen those completions for them the next time. The problem is that it behaves quite oddly, and here is an example that illustrates why:
console.
vscode will suggest all of the available methods ofconsole
.exception
.console.
again. Vscode will immediately suggestexception
, as expected. And now here is the weird part: Typee
, and instead of still suggestingexception
, it will suggesterror
!The problem here is that once you type anything after the suggestion came, vscode will completely disregard your completion history and will just give you the best match lexicographically. Even if in the example you have completed
exception
by typing ane
and then having it complete it, the same thing will occur. My suggestion is that when you have already typed something, the 'suggest selection' will just be filtered by what you have typed, instead of stop working. So in the example, after you have typede
, it will still suggestexception
."Switch the Suggest Selection settings to "recentlyUsedByPrefix" and it will work!" Yes it does make it sometimes work but overall it makes the situation much worse. For example if you type just
console.
it won't suggest exception no matter what you have done before.