Open Sherlock-Holo opened 1 year ago
oh... it seems when enable
Use rustfmt instead of the built-in formatter
the Ctrl+Alt+L doesn't work anymore, in previous version, these a lot of blank lines will be removed
I investigated and found that described behavior may occur when the option "optimize import" in the "Reformat File" menu is active. It happens because this option also impacts the "Reformate Code" function. Interestingly, when this option is active, blank lines don't remove. And if I uncheck the option "optimize import" in "Reformat File" and run "Reformate Code", imports don't change lines, and blank lines are removed. Could you please, check this option on your side?
I tried disable the optimize import, the blank lines are removed, but the unused imports still exists and intellij-rust just move them to the correct position(when they are used, the position which cargo fmt
may choose)
after re-enable the optimize import, the unused import are removed, but blank lines still exists
in previous version intellij-rust, when enable optimize import and the Use rustfmt instead of the built-in formatter, the Ctrl+Alt+L will format the codes like just run cargo fmt
directly
Thank you for providing additional information. The cause of this behavior is that, for some unclear reasons, "rustfmt" doesn't function despite the "Use rustfmt instead of the built-in formatter" option being activated. I forwarded the issue description to our developer team to investigate the root cause of the issue. When we have any new information about it, we will add a reply to this ticket.
I had this issue on RustRover. I resolved it by turning off Rearrange Code
Environment
Problem description
my projects is formated by
cargo fmt
when update the Clion to 2023.2 and update the intellij-rust, when I press Ctrl+Alt+L, I found there is a different:
the intellij-rust format result is not equal
cargo fmt
I already enable this
Steps to reproduce