rust-playground icon indicating copy to clipboard operation
rust-playground copied to clipboard

feat(ui/frontend): add shortcuts for tools

Open ShaunSHamilton opened this issue 2 years ago • 2 comments

Adds shortcuts to tools. Global event listener is added for the following keydown events:

Keys Result
Ctrl + Alt + f Rust Fmt on the code
Ctrl + Alt + m Miri
Ctrl + Alt + x Macro Expansion
Ctrl + Alt + c Clippy

The above can easily be changed. However, certain combinations are reserved by different browsers.

What this looks like

I realise the background colour from the issue was probably for emphasis. So, am obviously happy to change/remove it.

image

Closes #844


Aside: More ESLint/editor rules should be added, as I constantly needed to avoid saving with formatting.

ShaunSHamilton avatar Dec 25 '22 01:12 ShaunSHamilton

Could I suggest adding something like ctrl+alt+t to run tests? Helpful when you have both a main and #[test]s

tgross35 avatar Mar 15 '23 22:03 tgross35

There's also https://github.com/rust-lang/rust-playground/issues/814 which suggested capturing ctrl+s to run the code. That's the current behavior of the monaco editor, but it could be good to capture it for the others

tgross35 avatar Mar 15 '23 22:03 tgross35