cquary 转 ccls

这2天分别用了一下 cquary 和 ccls

从我个人角度 我更推荐ccls

ccls 作者更勤奋 而且就在论坛里 有什么问题也比较好沟通

cquary反正我用了一下 各种奇奇怪怪的问题

用了ccls 丝般顺滑 而且支持c++17

同意。 我也是比较了这两个以后选了ccls。

问个问题。。。(setq ccls-cache-dir “~/tmp/”) 怎么没用 缓存还是在项目中




but the .ccls-cache still in my project root

use the same way ! cquery ok but ccls not worked


(setq ccls-cache-dir (file-truename "~/tmp"))

还是不行。。。依然生成在project root下

不要想当然,多看看文档。 https://github.com/MaskRay/ccls/wiki/Initialization-options

看过了 就是说会生成在项目路径下 可否赐教怎么改?

要用绝对路径,比如 /home/foo/tmp , ccls 没有做 expansion

绝对路径也用过 没软用

  (setq ccls-initialization-options `(:cacheDirectory "/tmp/ccls_cache"))


1 个赞

It doesn’t provide ccls-* custom variables because I try to avoid putting configurations in multiple places.

emacs-cquery used to have more custom variables. The discrepancy of naming convention and duplicate documentation was a pain. In emacs-ccls, I just deleted most of them and kept the minimum.

It isn’t unnatural for VSCode to provide these forwarding variables because the JSON initializationOptions really fit well into it. It also has nice completion. lsp-clients-go as defined by lsp-clients.el currently has a more serious problem:

(defun lsp-clients-go--make-init-options ()
  "Init options for golang."
  `(:funcSnippetEnabled ,(lsp-clients-go--bool-to-json lsp-clients-go-func-snippet-enabled)
                        :gocodeCompletionEnabled ,(lsp-clients-go--bool-to-json lsp-clients-go-gocode-completion-enabled)
                        :formatTool ,lsp-clients-go-format-tool
                        :goimportsLocalPrefix ,lsp-clients-go-imports-local-prefix
                        :maxParallelism ,lsp-clients-go-max-parallelism
                        :useBinaryPkgCache ,lsp-clients-go-use-binary-pkg-cache
                        :diagnosticsEnabled ,lsp-clients-go-diagnostics-enabled))

You should really read the documentation more carefully, and/or, of course, the project names.