lang/cc: decouple lsp init from ccls package

This commit is contained in:
Henrik Lissner 2019-08-27 00:04:11 -04:00
parent 8766499b0d
commit af26a14230
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395

View file

@ -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!)))