Add "reformat with rustfmt" action
See original GitHub issueBasically, run cargo fmt
on the current file. Use this to run execute cargo. Path to Cargo is available via SDK. You’ll need the skip-children rustfmt flag.
Relevant docs: http://www.jetbrains.org/intellij/sdk/docs/basics/getting_started/creating_an_action.html http://www.jetbrains.org/intellij/sdk/docs/basics/action_system.html http://www.jetbrains.org/intellij/sdk/docs/basics/getting_started/creating_an_action.html
Issue Analytics
- State:
- Created 8 years ago
- Comments:6 (6 by maintainers)
Top Results From Across the Web
Rust - Code style and formatting - JetBrains Marketplace
To reformat a selection, you can only use the IDE formatter (see Reformat a selection for more information). To customize Rustfmt calls, navigate...
Read more >Configuring Rustfmt
Rustfmt is able to pick up the edition used by reading the Cargo.toml file if executed through the Cargo's formatting tool cargo fmt...
Read more >Rust format does not work with a very specific code structure
I've noticed rustfmt stopped working in my file. ... who will not work on my code does not seem like a reasonable course...
Read more >Forced rustfmt is a roadblock to contributing - Rust Internals
rustfmt goes way beyond that to making formatting and AST relationship ... Here's some discussion about supporting that w\ GitHub Actions:.
Read more >Automatically format and lint code with pre-commit - Interrupt
It took about 10 minutes to add pre-commit to our repo, and it helped me keep my patches clean and tidy! Why this...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
If you invoke
cargo fmt
then it will look inside.cargo/bin
regardless ofPATH
. To pass arguments torustfmt
, you can use--
:@matklad one more question is that if i use
rustfmt
it will just format the specific file but if i usecargo fmt
it will format the super mod file either, just like the verbose progress message shown below.is it an expected behavior here?