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

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

Open
vincent-czi opened this issue Sep 1, 2021 · 3 comments

Comments

@vincent-czi
Copy link
Contributor

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)
@dinvlad
Copy link
Contributor

dinvlad commented Sep 1, 2021

Thanks for reporting - would you be willing to submit a PR with a fix?

@vincent-czi
Copy link
Contributor Author

PR made. I would very rarely run the code command, so I also added alt to avoid shadowing the many other shift+enter commands. If you think most of your users rely on it heavily though, that should possibly be removed.

@dinvlad
Copy link
Contributor

dinvlad commented Sep 2, 2021

Merged! The new build should be published shortly - please let me know if you still have issues after the 0.0.77 update..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants