-
Notifications
You must be signed in to change notification settings - Fork 645
Format via stdin instead of document file path #1069
Conversation
Fixes double save issues as now we don't have to save the document to do formatting. Also fixes save on "Format Document" (now no save is done). Related to microsoft#1037
Seems to work fine in my limited tests. Feedback very welcome! One possible issue with this change is that
|
I must say that i'm very impressed by the the visual code extension development experience and vscode-go code quality, was very easy to get going! |
I noticed one thing while reading the code. In |
Maybe with this change |
Thanks for the PR. Am back from the vacation and had some time to dig around my previous work with both using On the usage of onWillSaveTextDocument: Telemetry shows that about 1/5th of the Go extension users have had formatting times > 1.5 secs. Either, the users have to live with that or we need to be able to provide a fallback I'll look into what options we have. On the usage of stdin: The last time I did this, there were 2 bugs that surfaced due to which I had to revert the change
I believe these will occur again with your changes as well? |
We use |
Also once you have the |
@ramya-rao-a Thanks for the feedback About diff i just found that gofmt actually uses external diff https://github.com/golang/go/blob/master/src/cmd/gofmt/gofmt.go#L257 i just assumed the diff was done in go somehow 😄 Hopefully I will have some time to look into this again this week. Yeah i also suspect that my change will reintroduce those issues again, will try to to see if it can be fixed. |
7259f77
to
f6936fa
Compare
89e20b7
to
3d8a1f0
Compare
7d591f1
to
a8a68e2
Compare
Closing this in favor of e95eed6 |
Fixes double save issues as now we don't have to save
the document to do formatting.
Also fixes save on "Format Document" (now no save is done).
Related to #1037