vscode-rust
vscode-rust copied to clipboard
`actionOnSave` does not trigger when saving and file is clean
Version of the extension: 0.3.10
The actionOnSave
configuration parameter works only when a file is saved and was also dirty. VS Code now allows you to save manually, even when the file is not dirty.
Running in legacy mode with "rust.executeCargoCommandInTerminal": true
.
Hello @redactedscribe, I didn't checked that. I will.
In my opinion, the extension behaves correctly now. I don't like the new feature introduced by VSCode. All commands, which are possible to invoke on saving, may be invoked from the command palette. I am inclined to keep the behavior.
I am asking other people to speak up if they disagree.
I disagree. Personally I prefer things like fmt and clippy to run every time I save, including when the file is clean.
@mtsr, I am not sure if you understand what we are talking about. "A file is clean" means it has no unsaved changes. You still execute any command, format via Right Click.
From my perspective, the parameter is named actionOnSave
and therefore should execute when save occurs, no matter if the file is clean. I have found myself often typing a
to dirty the file, just to save to trigger a build. It's more convenient than Ctrl+Shift+R/B for me.
Okay. If you say so. I will modify code.
@KalitaAlexey I'm in agreement with @mtsr and @redactedscribe here.
To me, actionOnSave
in any context is a way to say "When you attempt to save a file, these are the action(s) that will performed prior to saving that file."
To put it another way, regardless of whether we agree or not, I can't think of any reason why only triggering on dirty files is better than always triggering.
Commonly used for things like formatters and such, sure, but anyone who uses it to do something like build+run benefits from it triggering on every save, not just dirty saves.
On top of that, triggering on every save has no effect on those of us only using it for formatting, since attempting to format an unchanged file should basically do nothing since our last save would've already formatted it!
@joshsleeper, I got the point. I have no time for this. I am going to do this before publishing a new version. I suppose in two days.