Open dlsniper opened 9 years ago
As a temporary workaround you can use go fmt as an external formatter as well via Code > Go fmt file/project actions. Also you can enable this option for every commit:
I haven't noticed those options and I'm using git from command line. Thanks.
@kokizzu That StackOverflow link redirects back to a GH issue: https://github.com/go-lang-plugin-org/go-lang-idea-plugin/issues/1324#issuecomment-75263115
Hoping this saves some others from having to do the roundabout trip :)
Using the nightly plugin but the menus for Go fmt or Goimports on file are disabled even though I'm editing a .go file and also have goimports installed, in the PATH and working fine from cmd line, only the one for the project is enabled. Any ideas? There must be some setting that I don't have right.
@bits01 please file a separate issue with more details (https://github.com/go-lang-plugin-org/go-lang-idea-plugin/blob/master/CONTRIBUTING.md#reporting-errors)
The plugin can't detect goimports
in your GOPATH/bin/goimports
. Can you please open an issue and share a screenshot of your Settings -> Languages & Frameworks -> Go -> Go libraries. Also see what @zolotov just linked. Thanks
The formatting in IDEA is very different than the one from gofmt (or goimports).
I know this is a pretty generic ticket so let me know how should I best add information to it. In 0.9.x branch there's a bunch of tests that should cover the source code formatting, and that's a very good start for it and Mihai started working on a new formatting engine a while ago, which can be found here: https://github.com/go-lang-plugin-org/go-lang-idea-plugin/tree/formatter_work
Since the go community is very keen on having all projects respecting gofmt, this should be a must for the initial stable release of the plugin.
Alternatively, integration with gofmt or goimports like we have for 0.9.16 could be done, where we execute gofmt/goimports on save, which could be good enough to start with, even if it's against the way IDEA should handle the issue.
Thanks.