lang/cc: decouple lsp init from ccls package
This commit is contained in:
parent
8766499b0d
commit
af26a14230
1 changed files with 13 additions and 8 deletions
|
@ -230,17 +230,22 @@ This is ignored by ccls.")
|
||||||
;;
|
;;
|
||||||
;; LSP
|
;; LSP
|
||||||
|
|
||||||
|
(when (featurep! +lsp)
|
||||||
|
(add-hook! '(c-mode-local-vars-hook
|
||||||
|
c++-mode-local-vars-hook
|
||||||
|
objc-mode-local-vars-hook)
|
||||||
|
(defun +cc-init-lsp-h ()
|
||||||
|
(setq-local company-transformers nil)
|
||||||
|
(setq-local company-lsp-async t)
|
||||||
|
(setq-local company-lsp-cache-candidates nil)
|
||||||
|
(lsp!))))
|
||||||
|
|
||||||
|
|
||||||
(use-package! ccls
|
(use-package! ccls
|
||||||
:when (featurep! +lsp)
|
:when (featurep! +lsp)
|
||||||
:hook ((c-mode-local-vars c++-mode-local-vars objc-mode-local-vars) . +cc|init-ccls)
|
:after lsp
|
||||||
:init
|
:init
|
||||||
(after! projectile
|
(after! projectile
|
||||||
(add-to-list 'projectile-globally-ignored-directories ".ccls-cache")
|
(add-to-list 'projectile-globally-ignored-directories ".ccls-cache")
|
||||||
(add-to-list 'projectile-project-root-files-bottom-up ".ccls-root")
|
(add-to-list 'projectile-project-root-files-bottom-up ".ccls-root")
|
||||||
(add-to-list 'projectile-project-root-files-top-down-recurring "compile_commands.json"))
|
(add-to-list 'projectile-project-root-files-top-down-recurring "compile_commands.json")))
|
||||||
:config
|
|
||||||
(defun +cc|init-ccls ()
|
|
||||||
(setq-local company-transformers nil)
|
|
||||||
(setq-local company-lsp-async t)
|
|
||||||
(setq-local company-lsp-cache-candidates nil)
|
|
||||||
(lsp!)))
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue