tools/lsp: fix company-lsp not being enabled
Due to a load-order issue between company and lsp.
This commit is contained in:
parent
0dab58ef19
commit
5cabbef6ef
1 changed files with 10 additions and 5 deletions
|
@ -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 ()
|
||||||
|
(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
|
(cons 'company-lsp
|
||||||
(remq 'company-capf company-backends))))
|
(remq 'company-capf company-backends)))
|
||||||
|
(remove-hook 'company-mode-hook #'+lsp|init-company t)))
|
||||||
|
(add-hook 'lsp-mode-hook #'+lsp|init-company))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue