Vscode: Missing keybinding for navigation in Quick Fix contextual menu

Created on 26 Jul 2018  路  15Comments  路  Source: microsoft/vscode

The problem:

It is not possible to define custom shortcuts for Quick Fix contextual menu.

  • Use latest stable build of VS code and open a TypeScript project.
  • Open the Quick Fix by intentionally making a mistake in the code.
  • Press CTRL + . to open the Quick Fix contextual menu suggestions.
  • It is possible to select an item from the menu by using UP/DOWN arrow key.
  • ISSUE: it is no possible to define custom shortcuts in order to select the prev/next Quick Fix suggestion in the contextual menu.
    Would be great to have customize selection of the prev/next suggestion, similarly to IntelliSense (example below):
    {
      "key": "ctrl+k",
      "command": "selectPrevSuggestion",
      "when": "suggestWidgetMultipleSuggestions && suggestWidgetVisible && textInputFocus"
    },
    {
      "key": "ctrl+j",
      "command": "selectNextSuggestion",
      "when": "suggestWidgetMultipleSuggestions && suggestWidgetVisible && textInputFocus"
    },
editor-code-actions feature-request menus upstream

Most helpful comment

Please prioritize. The lack of custom binding is a productivity killer for vim-like users. The workflow is interrupted each time you have to reach for the arrow keys. And some linux-centric keyboards don't even have the arrow keys. They would have to press combo keys to get the arrow keypress event.

All 15 comments

To my knowledge that isn't possible because we are using a native menu.

so sad, i am trying to bind the up/down to 'j', 'k', and blocked here. is there any workaround?

So sad, can't use shortcut to move in Quick Fix contextual menu break my coding experience. can you fix this bug quickly?

This feature request is now a candidate for our backlog. The community has 60 days to upvote the issue. If it receives 20 upvotes we will move it to our backlog. If not, we will close it. To learn more about how we handle feature requests, please see our documentation.

Happy Coding!

please fix this quickly

:slightly_smiling_face: This feature request received a sufficient number of community upvotes and we moved it to our backlog. To learn more about how we handle feature requests, please see our documentation.

Happy Coding!

Please prioritize. The lack of custom binding is a productivity killer for vim-like users. The workflow is interrupted each time you have to reach for the arrow keys. And some linux-centric keyboards don't even have the arrow keys. They would have to press combo keys to get the arrow keypress event.

is there any internal API do get the code actions? having them displayed in menu at the top like Quick Open would already solve this issue

I created a extension as a workaround:
https://marketplace.visualstudio.com/items?itemName=pascalsenn.keyboard-quickfix

It uses the quick open picker to display codeactions.
It is possible to navigate through these with the keyboard

@PascalSenn did you figure out a good way to display "No code actions available"? That's the road block I ran into (though not really a big deal, just curious).

@SeeminglyScience i did not think about that. Added it in 0.0.4.
Might take a few minutes to show up on the market place
image

@PascalSenn could you please add a command like keyboard-quickfix.toggleQuickFix to open/close quickFix using the same command?

Have a lot to do currently, but you can open an issue here:
https://github.com/PascalSenn/keyboard-quickfix/issues

Currently as a work around I use the following key biding in keybindings.json, I hope you find it useful.

[
  {
    "key": "ctrl+k",
    "command": "selectPrevSuggestion",
    "when": "suggestWidgetMultipleSuggestions && suggestWidgetVisible && textInputFocus"
  },
  {
    "key": "ctrl+j",
    "command": "selectNextSuggestion",
    "when": "suggestWidgetMultipleSuggestions && suggestWidgetVisible && textInputFocus"
  }
]

@gibbok

It doesn't work for me. I added these mappings and navigation inside the popup window with suggestions isn't working. I don't have any other commands bound to these combinations.

Was this page helpful?
0 / 5 - 0 ratings