-
Notifications
You must be signed in to change notification settings - Fork 645
go.formatTool: "goimports" and go.formatOnSave: true should be default #253
Comments
What is the current default? I thought the default was to run Also, I still think it makes a better default for beginners, especially if they have it on from day 1, but I wanted to point out the above concerns. I think vscode-go might've had some history with auto-save being on by default, which might relevant here. Edit: See related issues: |
The current default can be seen in the README.md here: https://github.com/Microsoft/vscode-go#options I've also verified in my VSCode editor, it is:
and marked as I agree that |
We can definitely remove the "EXPERIMENTAL" on The one concern with changing the defaults is that some VS Code users like to use AutoSave, which causes the editor to immediately save after a short delay of typing. This is nice for Go because it triggers compile/lint checks automatically. However, these two features interact imperfectly. Sometimes you pause during typing and That said - I think at this point it's probably worth changing the default to have I'm inclined to leave |
This is actually maddening and the reason I don't use that setting combo. |
@ironcladlou Out of curiosity - are you suggesting that we should not turn format-on-save on by default? Or that you don't use |
I don't use auto-save, but if I did use auto-save I wouldn't like I'm neutral towards the defaults given there are options to make everything behave as I like. |
Got it - great. Since AutoSave is off by default in Code, and actually now less discoverable, I think it makes sense to tune the defaults to match what works best with that off - which means turning format-on-save on. We can include documentation about the conflict. |
As an almost full-time Go developer since 2012.. There is literally no reason why
goimports
should not be enabled by default for format-on-save. It is non-risky, does not ever damage code, and unlike many other languages the Go community highly highly encourages one standard format. If this was, C, C++, etc I could understand not enabling a a fmt command by default, but in Go there is literally no risk whatsoever of angering users or modifying code in an undesired way./cc @shurcooL because I think he would feel the same way.
The text was updated successfully, but these errors were encountered: