-
Notifications
You must be signed in to change notification settings - Fork 30.9k
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
editor.action.quickFix to select the first item in the suggestions by default (C#) #13631
Comments
fyi - in latest insiders (https://code.visualstudio.com/insiders) this is now using the native context menu. We can also think about adding hot keys for each of them (like Cmd+1, Cmd+2, etc) |
@jrieken Electron provides API to automatically select a specific index of a context menu, we just did not expose it in our internal service API, but that is easy to do. Maybe if there is only 1 quick fix we select it by default? My scenario is to fix imports and there I like to quickly use |
Looks like only on macOS electron allows to set the index of the selected context menu entry. |
PR ready: #33881 |
This is related to the sorting/ranking which isn't a solved problem yet: #33756 |
@jrieken my main use case is actually getting an import in and for that case there is only one proposal: So a variant of my change could be to only select the first item automatically if there is just 1 quick fix overall. That would help me, but maybe not the author of this issue. |
I'm going to add some extra information to this issue because by look of the comments it perhaps wasn't clearly described. The proposa itself was to automatically navigate to the first element of the possible "fixes" when I press Ctrl+. In none of the case my proposa was to automatically choose and apply that fix, was only to navigate to the first element on the list so just "Enter" would select the element chosen therefore it would save the coder from having to press the arrow down to start navigating through the list. It is what happens in ReSharper, you press Alt+Enter and you get the list of solutions and the first one is selected by the default. If you then press Enter it would then apply your selections which normally turns to be the first item. Hope it is clearer now |
@CarlosTorrecillas yes, that is what my PR basically does. |
Steps to Reproduce:
Ideally it would be an enhancement if the shortcut can auto select the first item in the list by default.
The text was updated successfully, but these errors were encountered: