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
Completion commits unwanted completions that don't matched typed prefixes #55450
Comments
(Experimental duplicate detection) |
Sounds like a duplicate of #54386. Should be fixed in insiders |
Isn't that just supporting disabling commit characters? I want commit characters, just not where they don't make sense or are super-fuzzy 😕 |
TypeScript uses intellisense to enable / disable |
It was actually TypeScript I was thinking about here (though I do want to improve it in Dart too!), I looked at the changeset against that related case (cbcafcc) and it seemed like it was just supporting being turned off based on a setting. If you're handling this conditionally, where can I find the code? I was under the impression that we had very limited control over this (because the commit characters are provided to VS Code once, then it filters things on its own, with no option for us to affect whether a character commits during that?). |
No you can't do it dynamically as you type. TS tells us if we are in a new identifier location (such as an parameter name) and we use this to disable commit characters: https://github.com/Microsoft/vscode/blob/cbcafcc28463156179321a4190c479c92189f43a/extensions/typescript-language-features/src/features/completions.ts#L321 |
Aha, that makes sense - I'll open an issue to see if we can get something similar back from Dart, thanks! |
I was writing this code that calls
sortBy
in lodash. The second argument is a function/lambda and the completion opened when I started typing a variable name. I don't want to complete here because I'm typing a new variable name - however when I pressed,
it automatically committed, and resulted inSSL_OP_NO_TLSv1_1
being inserted.Sorry the gif is slow, happened when I converted to GIF!
Here the characters I typed are
matches, t1,
. The comma is a commit character in TypeScript.This happens quite a lot and is rather frustrating. I don't think it ever makes sense to honour the commit character on a completion if the proceeding text doesn't match (or at least, it should be optional). I have a similar issue in my Dart extension and tried to solve it by only setting completion characters when the proceeding text matches, however since VS Code doesn't re-call the completion provider on every key stroke (it filters "client-side") this doesn't work correctly.
I know I could turn probably turn this behaviour off entirely, but I think it's really useful in the right context. If I've typed
sort
and the top item issortBy
then pressing(
to complete is great. What's described above however, is not. I don't think this is fixable in the TypeScript, I think it needs support from VS Code.The text was updated successfully, but these errors were encountered: