Replace cquery with ccls for C/C++ LSP support
This commit is contained in:
parent
35a1038ee9
commit
cd997383da
2 changed files with 10 additions and 11 deletions
|
@ -224,17 +224,16 @@ compilation database is present in the project.")
|
||||||
;;
|
;;
|
||||||
;; LSP
|
;; LSP
|
||||||
|
|
||||||
(def-package! cquery
|
(def-package! ccls
|
||||||
:when (featurep! +lsp)
|
:when (featurep! +lsp)
|
||||||
:hook ((c-mode c++-mode objc-mode) . +lsp|init-cquery)
|
:hook ((c-mode c++-mode objc-mode) . +lsp|init-ccls)
|
||||||
:config
|
:config
|
||||||
(defun +lsp|init-cquery ()
|
(defun +lsp|init-ccls ()
|
||||||
(setq-local company-transformers nil)
|
(setq-local company-transformers nil)
|
||||||
|
(setq-local company-lsp-async t)
|
||||||
(setq-local company-lsp-cache-candidates nil)
|
(setq-local company-lsp-cache-candidates nil)
|
||||||
(condition-case nil
|
(lsp))
|
||||||
(lsp)
|
(after! projectile
|
||||||
(user-error nil)))
|
(add-to-list 'projectile-globally-ignored-directories ".ccls-cache")
|
||||||
(setq cquery-extra-init-params
|
(add-to-list 'projectile-project-root-files-bottom-up ".ccls-root")
|
||||||
'(:index (:comments 2)
|
(add-to-list 'projectile-project-root-files-top-down-recurring "compile_commands.json")))
|
||||||
:cacheFormat "msgpack"
|
|
||||||
:completion (:detailedLabel t))))
|
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
(package! company-glsl :recipe (:fetcher github :repo "Kaali/company-glsl"))))
|
(package! company-glsl :recipe (:fetcher github :repo "Kaali/company-glsl"))))
|
||||||
|
|
||||||
(if (featurep! +lsp)
|
(if (featurep! +lsp)
|
||||||
(package! cquery)
|
(package! ccls)
|
||||||
(when (package! irony)
|
(when (package! irony)
|
||||||
(package! irony-eldoc)
|
(package! irony-eldoc)
|
||||||
(when (featurep! :tools flycheck)
|
(when (featurep! :tools flycheck)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue