-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Format on auto-saving doesn't work #3256
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
Comments
This is interesting, I don't know where this formatting comes at all... @matklad do you know where the Rust formatter comes from? |
I just really started getting into rust, so excuse my ignorance. Same for vscode plugins. I ran into Usage is |
This isn't working for me either. I have the latest version. |
@blitzerr running
|
Had the same problem, had I looked into my
and removing this fixed the auto-formatting for me :) |
No, this is still not working for me. I have |
Actually, it seems that this is a vscode specific problem... microsoft/vscode#45997 // Format a file on save. A formatter must be available, the file must not be saved after delay, and the editor must not be shutting down.
"editor.formatOnSave": false, https://code.visualstudio.com/docs/getstarted/settings |
Maybe it should be this:
with
all of which go in |
Perhaps |
That one will definitively not work. Only nightly rustfmt supports range formatting and rust-analyzer doesn't implement support for using this mode. |
But `modificationsIfAvailable` won't fall to `file` if rustfmt is not
available for modifications. You have to manually point out in rust
settings to override the global which I assume that would format at least
in `file` way.
bjorn3 ***@***.***> 于 2021年10月14日周四 01:31写道:
… "editor.formatOnSaveMode": "modifications"
That one will definitively not work. Only nightly rustfmt supports range
formatting and rust-analyzer doesn't implement support for using this mode.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#3256 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABU6KCIZ7HTUIU44GHPHZADUGW66VANCNFSM4KY6FOHQ>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
|
"formatOnSave" also does not work when VSCode opens symlinked project. The "Rust Analyzer Client" output error info is:
|
I have had problems when the auto format simply stops working and for me it was because I was using too long module statements e.g I was using a function without importing it:
in order for the auto formater to come alive again. Might be similar issues for some of you so I thought I might write it here. |
@pinkponk when this happens, try |
This wasn't working for me. After going through my settings, I found I changed it to Can definitely confirm the other comment about this solution |
For me it was this setting that made it work:
|
There seem to be working workarounds here and as this i a client issue in the first place I'll go ahead and close this |
I have
formatOnSave
enabled andautoSave
set. Yet automatic saving does not seem to trigger formatting as manual saving does. Is this a rust-analyzer issue?The text was updated successfully, but these errors were encountered: