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

Add shortcut to run rustfmt #844

Open
pseyfert opened this issue Sep 15, 2022 · 2 comments · May be fixed by #871
Open

Add shortcut to run rustfmt #844

pseyfert opened this issue Sep 15, 2022 · 2 comments · May be fixed by #871
Labels
enhancement Something new the playground could do help wanted Not immediately going to be prioritized — ask for mentoring instructions!

Comments

@pseyfert
Copy link

I think it would be nice if one could run rustfmt from a keyboard shortcut, similar to ctrl+return to run code, or ctrl+F9 on compiler-explorer.org.

@shepmaster shepmaster added enhancement Something new the playground could do help wanted Not immediately going to be prioritized — ask for mentoring instructions! labels Sep 19, 2022
@shepmaster
Copy link
Member

This was something we had discussed a long while ago, and I'm generally in favor. Some thoughts:

  1. We should do it for all the tools
  2. We should show the shortcuts in the tools menu:
    image
  3. We should be able to use these shortcuts both when the cursor is and is not focused on the editor component.
  4. We should think about making them comfortable for both macOS vs Linux/Windows users.

@ian-h-chamberlain
Copy link

ian-h-chamberlain commented Nov 16, 2022

Another nice-to-have that's related to this would be vim-mode shortcuts for the same actions. For most of them perhaps just a command like :expand-macros or something would work, but for formatting it might also be nice to set vim's formatprg if possible, so that gq would invoke rustfmt as well (not sure if this is possible with codemirror, it might require a bit of extra plumbing or not really be worth it). Similar could be = and equalprg although which to use seems like a personal preference.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Something new the playground could do help wanted Not immediately going to be prioritized — ask for mentoring instructions!
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants