Description
For example, a simple Go file:
package main
func main() {}
Say I change main
to foo
and hit save. I'm using goimports
to format; when save runs the formatter, nothing is changed because my code is already formatted correctly. However, VSCode-Go still seems to replace the entire document, which means that if I hit cmd-Z
, nothing happens. I have to hit cmd-Z
once more in order to undo my change.
VSCode-Go should realize that the newly formatted file is the same as the current file, and do nothing.
To be honest, I'd prefer if formatOnSave
did not count as part of the undo stack. I'd prefer "save + undo" to undo the format and my last edit, which is a lot more rational; they do belong together, and I'd argue there's absolutely utility to undoing only the formatting but not your own edit. However, I don't know if VSCode offers the necessary plumbing to group undo operations like this. I noticed a very similar problem with the Autotrim extension.
Activity