-
Notifications
You must be signed in to change notification settings - Fork 29.4k
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
Intellisense dismisses inline completions even if intellisense selected item and inline completion prefix match #170527
Comments
You want these two internal settings enabled in settings.json btw |
Hey folks, happy new year. -A |
As per convo between Henning & Jui: the behaviour will be redesigned, this issue hasn't been looked at yet: |
This particular situation was not supported before, also the docs stated that this wouldn't work. Anyway, I changed it sligthly so that this case should work now. I also fixed some other issues (regarding suggest widget preselection). |
|
I ran the repro steps in the latest Insiders The bug that I had initially reported seems to have been fixed however, it didn't fix the problem entirely. When I type |
@hediet The case of "when inline completion is on the screen and the user overtypes, intellisense should show with the prefix of the inline completion pre-selected in intellisense" is supported by the two hidden settings ("editor.inlineSuggest.allowQuickSuggestions": true, "editor.inlineSuggest.allowSuggestOnTriggerCharacters": true). The bug I filed is a subset of this. |
Can be reproduced in the playground: Fixed in upcoming version (just select the newest version in the playground): |
Does this issue occur when all extensions are disabled?: Yes/No
Steps to Reproduce:
Use the project in https://github.com/microsoft/vscode-extension-samples/tree/main/inline-completions. In the extension.ts, enable completeBracketPairs.
Run the project
Open an empty .ts file and type
[0,*):if (var) {
When you hit Enter, the prediction you see on the screen will be
[0,*):if (var) {}
. Note the curly brace is closed.Now type along the prediction, when you type
v
, Intellisense will selectvar
but despite this, the prediction gets dismissed. The expected behavior is that inline prediction stays because Intellisense item is the same.This bug happens specifically when there are brackets are autoclosed by completeBracketPairs. I investigated further and noticed this condition was returning false. For the above example, the augmentedCompletion.range was [4,6]->[4,7] whereas the suggestInlineCompletion.range was [4,6]->[4,6].
My suspicion for why augmentedCompletion.range was ending with [4,7] was that it's because 1 brace was added by completeBracketPairs, the range is incremented by 1. But even if completeBracketPairs adds 2 braces, the range remains [4,7].
cc @hediet
The text was updated successfully, but these errors were encountered: