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 (def-package! company-lsp
:when (featurep! :completion company) :when (featurep! :completion company)
:after lsp-mode :defer t
:config :init
;; Make sure that `company-capf' is disabled since it is incompatible with ;; Make sure that `company-capf' is disabled since it is incompatible with
;; `company-lsp' (see lsp-mode#884) ;; `company-lsp' (see lsp-mode#884)
(setq-hook! 'lsp-mode-hook company-backends (defun +lsp|init-company ()
(cons 'company-lsp (if (not (bound-and-true-p company-mode))
(remq 'company-capf company-backends)))) (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))