fix!(go): prefer upstream formatter config

BREAKING CHANGE: Since apheleia doesn't handle regions yet, this should be fine to leave
to upstream. This could be considered a breaking change if users rely on
this functionality.
This commit is contained in:
Ellis Kenyő 2022-11-17 17:40:27 +00:00 committed by Ellis Kenyo
parent d92219d8d8
commit e3a337ebd4
No known key found for this signature in database
GPG key ID: 298BE5D997EBAA02

View file

@ -11,14 +11,6 @@
:references #'go-guru-referrers :references #'go-guru-referrers
:documentation #'godoc-at-point) :documentation #'godoc-at-point)
;; Redefines default formatter to *not* use goimports if reformatting a
;; region; as it doesn't play well with partial code.
(set-formatter! 'gofmt
'(("%s" (if (or +format-region-p
(not (executable-find "goimports")))
"gofmt"
"goimports"))))
(if (modulep! +lsp) (if (modulep! +lsp)
(add-hook 'go-mode-local-vars-hook #'lsp! 'append) (add-hook 'go-mode-local-vars-hook #'lsp! 'append)
(add-hook 'go-mode-hook #'go-eldoc-setup)) (add-hook 'go-mode-hook #'go-eldoc-setup))