rust-playground
rust-playground copied to clipboard
feat(ui/frontend): add shortcuts for tools
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.
Closes #844
Aside: More ESLint/editor rules should be added, as I constantly needed to avoid saving with formatting.
Could I suggest adding something like ctrl+alt+t to run tests? Helpful when you have both a main and #[test]s
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