Skip to content

bug -- vscode -- keybinding for 'editor.action.codeAction' breaks "Find Previous" keybindingΒ #16

@vincent-czi

Description

@vincent-czi

Bug: Open the "find widget" (cmd+f), type whatever you want to search (that has multiple matches in the open file), hit enter a couple times. It will cycle forward through matches. Now hit shift+enter. Expected behavior: The match should cycle backward to the previous match ("Find Previous"). Actual behavior πŸ›: VS Code instead displays a mini-text pop-up saying "No code actions for 'wdl.run' available".

image

Cause: This behavior is caused by the very broad shift+enter keybinding to kick off a wdl.run code action. See here:

"key": "shift+enter",

Because "Find Previous" also uses shift+enter, these two conflict (there are also a lot of other possible conflicts, see the Keyboard Shortcuts page in VS Code and search for "shift enter"). I think because wdl-ide is an Extension, it gets precedence over the Default keybindings, so it always beats out "Find Previous". I could be wrong about the cause of precedence though: the Keyboard Shortcuts page allows you to "Sort by Precedence (Highest First)", and the above code action actually appears listed below Find Previous, but according to this issue [Extensions beat out Defaults] and this StackOverflow [You actually read precedence from bottom up in that table], I think the sort order has been flipped?

Proposed Solutions:

  • Set a when clause using editorLangId so the keybinding only applies when it's a WDL file.
  • Make it a more complicated, less commonly used keybinding (eg, shift+alt+enter) so less likely to overlap other Defaults
  • Set other when clauses that will help avoid matching Defaults (eg, ! findWidgetVisible)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions