tools/lsp: fix company-lsp not being enabled

Due to a load-order issue between company and lsp.
This commit is contained in:
Henrik Lissner 2019-07-05 23:42:06 +02:00
parent 0dab58ef19
commit 5cabbef6ef
No known key found for this signature in database
GPG Key ID: 5F6C0EA160557395

View File

@ -48,10 +48,15 @@
(def-package! company-lsp
:when (featurep! :completion company)
:after lsp-mode
:config
:defer t
:init
;; Make sure that `company-capf' is disabled since it is incompatible with
;; `company-lsp' (see lsp-mode#884)
(setq-hook! 'lsp-mode-hook company-backends
(cons 'company-lsp
(remq 'company-capf company-backends))))
(defun +lsp|init-company ()
(if (not (bound-and-true-p company-mode))
(add-hook 'company-mode-hook #'+lsp|init-company t t)
(setq-local company-backends
(cons 'company-lsp
(remq 'company-capf company-backends)))
(remove-hook 'company-mode-hook #'+lsp|init-company t)))
(add-hook 'lsp-mode-hook #'+lsp|init-company))