mirror of
https://github.com/jimeh/.emacs.d.git
synced 2026-02-19 13:46:41 +00:00
feat(lang): format go-mode buffers on save with gofumpt via lsp-mode
Also tweak a couple of other gopls settings, and set a others to their defaults for the purpose of ensuring they stay that way, and also to make it more obvious within emacs what options are available.
This commit is contained in:
@@ -52,6 +52,8 @@
|
||||
:config
|
||||
(when (not (getenv "GOPATH"))
|
||||
(exec-path-from-shell-copy-env "GOPATH"))
|
||||
(when (not (getenv "GOPRIVATE"))
|
||||
(exec-path-from-shell-copy-env "GOPRIVATE"))
|
||||
(when (not (getenv "GOENV_GOPATH_PREFIX"))
|
||||
(exec-path-from-shell-copy-env "GOENV_GOPATH_PREFIX"))
|
||||
|
||||
@@ -64,7 +66,22 @@
|
||||
:straight lsp-mode
|
||||
|
||||
:hook
|
||||
(go-mode . lsp-deferred))
|
||||
(go-mode . lsp-deferred)
|
||||
|
||||
:custom
|
||||
(lsp-go-use-placeholders nil)
|
||||
(lsp-go-link-target "pkg.go.dev")
|
||||
|
||||
:init
|
||||
(lsp-register-custom-settings
|
||||
'(("gopls.completeUnimported" t t)
|
||||
("gopls.completionBudget" "100ms")
|
||||
("gopls.completionDocumentation" t t)
|
||||
("gopls.deepCompletion" t t)
|
||||
("gopls.gofumpt" t t)
|
||||
("gopls.matcher" "Fuzzy")
|
||||
("gopls.staticcheck" t t)
|
||||
("gopls.symbolMatcher" "Fuzzy"))))
|
||||
|
||||
(use-package go-dlv
|
||||
:defer t)
|
||||
|
||||
Reference in New Issue
Block a user