chore(lang): Tweak company and whitespace options for golang

Setting company-echo-delay to 0.5 instead of 0 will help reduce unneeded
and intrusive code-completion popups while in the middle of typing. It
seemed like a good idea when I first set it, but after some use, no
thanks.

The whitespace-style tweak, effectively removes "indentation" from the
list of items whitespace-cleanup deals with on save. Indentation is
already being fixed by lsp-mode's before-save hooks, and
whitespace-cleanup was not very intelligent about it. It specifically
replaced all instances of four consecutive spaces in raw string
literals with a tab, which caused issues with multi-line raw strings
containing JSON.
This commit is contained in:
2020-03-30 21:24:34 +01:00
parent 5443b3dbc7
commit 3e31bf0f2f

View File

@@ -31,8 +31,9 @@
(defun siren-go-mode-setup ()
(setq-local tab-width 4
company-echo-delay 0
company-minimum-prefix-length 1)
company-echo-delay 0.5
company-minimum-prefix-length 1
whitespace-style (delete 'indentation whitespace-style))
(add-hook 'before-save-hook #'lsp-format-buffer t t)
(add-hook 'before-save-hook #'lsp-organize-imports t t)