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
code-completion doesn't use next suggestion on pressing tab multiple times #28215
Comments
Yeah, but why close popup on tab? If your correct suggestion isn't next in the list, and popup is closed you can run into a situation when you rapidly pressed tab key and gone too far in your list, then you could use ↑ to go up, but there is no popup so you wil probably change line. Well maybe someone dont like the fact that when completion is done, no matter wrong or right one, the list is still there and hovers above the code, hiding it from eyesight, and closing popup after first tab is good for them, but there are other people like me who like the opposite behavior, when the popup is always open until you close it by typing. So there may be an extra option for popup behavior |
A nice GIF showing what we can do in Sublime https://stackoverflow.com/questions/48883721/cycle-to-previous-suggestions-in-vscode |
This isn't exactly a duplicate of #34694, supertab in vim keeps the popup open, and doesn't pop up until you hit tab. Code completion the way VSCode handles it is really disruptive and slower than just typing out what I want :\ |
@ryanflorence well, the main idea of any modern autocompletion system is fuzziness. Thats is, you don't need to scroll through list most of the time. Let me demonstrate this: However it is not always possible to match with fuzzy, like here: BTW not regarding to topic, why supertab? It's not nearly as good as standard vim completion system, and far behind other async plugins like deoplete or neovim-completion-manager, or even that bloated YCM |
@andreyorst fuzzy searches are not orthogonal to cycling and I'm quite sure everyone here understands how fuzzy searches work you fuzzy-search when you know the symbol you're looking for (or have a strong suspicion) but don't want to write it all out yourself this issue isn't about fuzzy-searches however, it is about triggering autocomp and cycling, so let's stay ontopic |
ok, you want cycling. I'm not against cycling either. Let me explain myself. I'm against programmers who cycle around after every keypress, browsing kilometers of completion items, just to get single one, wich they even know about, but just because it's so fun to cycle around they will do it. In most cases you need to press one extra key (rarely two) to fuzzy match through hell lot of items in the list, but they will hold Tab and wait until chooser will reach their desired completion item. Thats why vscode completion system is good. It disciplines programmer to use his brain instead of brute force. It is hard to figure out how much more productive you will be if you will not scroll every time, and fuzzy match through. However cycling may benefit in some cases, when you have to deal with messed codebase, with large classes with tons of fields and methods, and you just want to examine it. The problem is only the fact that arrows used for that. |
This is how it works
|
@jrieken amazing work! |
😍 this is perfection. I loved this feature in Sublime and it would be great to get this into VSCode. You are the best, thank you so much! They call it "tab_completion", see here: https://www.sublimetext.com/docs/2/tab_completion.html |
Hm, we have |
This is now in master and will be in tomorrows Insiders build: Try it and let me know what you think. This is how it works
|
@jrieken What can I say... It's the best feature, I'm in heaven 😄 I'm using these settings and it feels amazing, no more annoying suggestions popup and I can easily autocomplete my changes by pressing
You did a really great job because it surpassed my expectations, it works perfectly!!! ❤️ |
Thanks for the nice feedback! |
since the conversation is happening here, I thought of combining my feedback @jrieken although the current feature in the Insiders is better than before, I was looking for something a bit different that is implemented in Xcode. See how tab keeps the IntelliSense open, as well as keeps highlighting matched elements. |
Is there going to be a when clause context that can detect when the suggestions are in this cycle mode? I am the author of an extension where the Maybe @jrieken knows the answer to my question? |
I found some contexts in the keybindings for the feature. |
Guys, this issue was closed, if you want to ask a feature request or something like that, please open a new issue. |
TL;DR the tab key should insert first suggestion, but then cycle through suggestions, replacing the last completion.
Sublime autocompletion can be configured so that when pressing the tab multiple times it will cycle through the autocompletions by inserting the first suggestion (closing the suggestion box), then replacing the suggestion by succeeding ones when pressing tab repeatedly.
Problem description:
Visually:
Textually:
Currently the corresponding controllers don't seem to support this, as accepting the current suggestion to my understanding will clear the suggestion list.
https://github.com/Microsoft/vscode/blob/3215f19074d49e32d5ab55203923865910d4d5ca/src/vs/editor/contrib/suggest/browser/suggestController.ts
https://github.com/Microsoft/vscode/blob/794b435b27bcf4a92cc0a6345b97821e3c827dcc/src/vs/editor/contrib/suggest/browser/suggestWidget.ts
How are people getting around having to press arrow-down and arrow-up 🤦♂️? I somehow never get the correct suggestion at the top and I quite frankly don't have the most flexible pinky 😢
The text was updated successfully, but these errors were encountered: