From 3e31bf0f2fc2a30ad6e76cb390e1bcd5c277cc74 Mon Sep 17 00:00:00 2001 From: Jim Myhrberg Date: Mon, 30 Mar 2020 21:24:34 +0100 Subject: [PATCH] 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. --- modules/languages/siren-golang.el | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/modules/languages/siren-golang.el b/modules/languages/siren-golang.el index 85dd1d1..ecd3908 100644 --- a/modules/languages/siren-golang.el +++ b/modules/languages/siren-golang.el @@ -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)