stamblerre / gocode

An autocompletion daemon for the Go programming language
MIT License
394 stars 28 forks source link

Feature request: goimports support in Sublime Text plugin #36

Closed imax9000 closed 4 years ago

imax9000 commented 5 years ago

Please add support for running goimports instead of gofmt on save.

A viable alternative - add an option to disable running gofmt on save entirely and let users use other plugins for code formatting.

christopher-dG commented 5 years ago

This package is only for autocompletion, you should be looking for this setting in the generic Go support layer for your editor (e.g. go-mode for Emacs, maybe this for Sublime).

imax9000 commented 5 years ago

FYI, goimports is a drop-in replacement for gofmt that automatically adds import lines. It doesn't do any autocompletion :)

E.g. if there was a configuration knob to specify a command to run on save, instead of hardcoded gofmt, that would do the trick already.

stamblerre commented 4 years ago

The editor-specific plugins in this repository are relics from https://github.com/nsf/gocode. The current recommendation for editor integration is using a specific plugin (like GoSublime, suggested above), or an LSP plugin with gopls. For Sublime, I believe https://github.com/tomv564/LSP works.