Skip to content
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

Closed
CarlosTorrecillas opened this issue Oct 12, 2016 · 8 comments · Fixed by #33881
Closed
Assignees
Labels
editor-code-actions Editor inplace actions (Ctrl + .) feature-request Request for new features or functionality release-notes Release notes issues verification-needed Verification of issue is requested verified Verification succeeded

Comments

@CarlosTorrecillas
Copy link

  • VSCode Version: 1.6.0
  • OS Version: 10.12

Steps to Reproduce:

  1. Get the quickfix bulb to appear after you need something that needs fixing
  2. You then need to press the arrow down to select the first item on the suggestions

Ideally it would be an enhancement if the shortcut can auto select the first item in the list by default.

@jrieken jrieken added feature-request Request for new features or functionality editor-code-actions Editor inplace actions (Ctrl + .) labels Oct 13, 2016
@jrieken
Copy link
Member

jrieken commented Oct 13, 2016

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)

screen shot 2016-10-13 at 10 31 01

@bpasero
Copy link
Member

bpasero commented Feb 27, 2017

@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 Cmd+. + Enter. I see the issue when having multiple quick fixes because then it could be that the first item is not the one I would expect.

@bpasero
Copy link
Member

bpasero commented Mar 1, 2017

Looks like only on macOS electron allows to set the index of the selected context menu entry.

@bpasero
Copy link
Member

bpasero commented Sep 6, 2017

PR ready: #33881

@jrieken
Copy link
Member

jrieken commented Sep 6, 2017

This is related to the sorting/ranking which isn't a solved problem yet: #33756

@bpasero
Copy link
Member

bpasero commented Sep 6, 2017

@jrieken my main use case is actually getting an import in and for that case there is only one proposal:

image

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.

@CarlosTorrecillas
Copy link
Author

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

@bpasero
Copy link
Member

bpasero commented Sep 6, 2017

@CarlosTorrecillas yes, that is what my PR basically does.

@jrieken jrieken added this to the September 2017 milestone Sep 11, 2017
@jrieken jrieken assigned bpasero and jrieken and unassigned jrieken Sep 11, 2017
@jrieken jrieken added the verification-needed Verification of issue is requested label Sep 25, 2017
@roblourens roblourens added the verified Verification succeeded label Sep 26, 2017
@jrieken jrieken added the release-notes Release notes issues label Sep 29, 2017
@vscodebot vscodebot bot locked and limited conversation to collaborators Nov 17, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
editor-code-actions Editor inplace actions (Ctrl + .) feature-request Request for new features or functionality release-notes Release notes issues verification-needed Verification of issue is requested verified Verification succeeded
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants