Merge pull request #1200 from flatwhatson/lsp-use-ccls

Replace cquery with ccls for C/C++ LSP support
This commit is contained in:
Henrik Lissner 2019-02-25 12:21:36 -05:00 committed by GitHub
commit fc6c575f1d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 11 deletions

View file

@ -224,17 +224,16 @@ compilation database is present in the project.")
;;
;; LSP
(def-package! cquery
(def-package! ccls
:when (featurep! +lsp)
:hook ((c-mode c++-mode objc-mode) . +lsp|init-cquery)
:hook ((c-mode c++-mode objc-mode) . +lsp|init-ccls)
:config
(defun +lsp|init-cquery ()
(defun +lsp|init-ccls ()
(setq-local company-transformers nil)
(setq-local company-lsp-async t)
(setq-local company-lsp-cache-candidates nil)
(condition-case nil
(lsp)
(user-error nil)))
(setq cquery-extra-init-params
'(:index (:comments 2)
:cacheFormat "msgpack"
:completion (:detailedLabel t))))
(lsp))
(after! projectile
(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-top-down-recurring "compile_commands.json")))

View file

@ -13,7 +13,7 @@
(package! company-glsl :recipe (:fetcher github :repo "Kaali/company-glsl"))))
(if (featurep! +lsp)
(package! cquery)
(package! ccls)
(when (package! irony)
(package! irony-eldoc)
(when (featurep! :tools flycheck)