From 69036e08efc95593832770cc183168aa4c6157bd Mon Sep 17 00:00:00 2001 From: Rickard Claesson Date: Thu, 9 May 2024 12:06:54 +0200 Subject: [PATCH] [go] Disable use of company-go when gopls is used The default backend for go-layer is lsp but company-go was still added to company-backends forcing it to search for gocode which should not be used since the user wants lsp. This change only adds company-go to company-backends if go-mode is selected as the backend. Note: go-mode is deprecated and gocode is not maintained anymore --- layers/+lang/go/packages.el | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/layers/+lang/go/packages.el b/layers/+lang/go/packages.el index 8578b9cfd7a5..cf58b6c16ec8 100644 --- a/layers/+lang/go/packages.el +++ b/layers/+lang/go/packages.el @@ -46,7 +46,8 @@ (defun go/init-company-go () (use-package company-go :defer t - :init (spacemacs|add-company-backends + :init (when (eq go-backend 'go-mode) + spacemacs|add-company-backends :backends company-go :modes go-mode :variables company-go-show-annotation t)))