-
Notifications
You must be signed in to change notification settings - Fork 4.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add +tools/cquery layer #10236
Add +tools/cquery layer #10236
Conversation
good!! |
fed69c7
to
e8d403c
Compare
With this PR, basic features work fine:
Some tricky parts. cquery saves a copy of indexed source files (so that it can serve requests when the index is out-of-sync with the source file in editing) in Adding the cache directory to (require 'projectile)
(add-to-list 'projectile-globally-ignored-directories ".cquery_cached_index") cquery users usually do not use ycmd for completion. However, ycmd is enabled by default in
Here is my personal layer https://github.com/MaskRay/Config/blob/master/home/.emacs.d/private/%2Bmy/cquery/packages.el Some shortcuts are really nice but I do not know where I should bind them. (dolist (mode '("c" "c++" "go" "haskell" "javascript" "python" "rust"))
(let ((handler (intern (format "spacemacs-jump-handlers-%s-mode" mode))))
(add-to-list handler 'lsp-ui-peek-find-definitions))
(let ((handler (intern (format "spacemacs-reference-handlers-%s-mode" mode))))
(add-to-list handler 'lsp-ui-peek-find-references)))
(defun cquery/base () (interactive) (lsp-ui-peek-find-custom 'base "$cquery/base"))
(defun cquery/callers () (interactive) (lsp-ui-peek-find-custom 'callers "$cquery/callers"))
(defun cquery/derived () (interactive) (lsp-ui-peek-find-custom 'derived "$cquery/derived"))
(defun cquery/vars () (interactive) (lsp-ui-peek-find-custom 'vars "$cquery/vars"))
(defun cquery/random () (interactive) (lsp-ui-peek-find-custom 'random "$cquery/random"))
(spacemacs/set-leader-keys-for-minor-mode 'lsp-mode
"la" #'lsp-ui-find-workspace-symbol
"lA" #'lsp-ui-peek-find-workspace-symbol
"lf" #'lsp-format-buffer
"ll" #'lsp-ui-sideline-mode
"lD" #'lsp-ui-doc-mode
"ln" #'lsp-ui-find-next-reference
"lp" #'lsp-ui-find-previous-reference
"lr" #'lsp-rename
)
(dolist (mode c-c++-modes)
(spacemacs/set-leader-keys-for-major-mode mode
"lb" #'cquery/base
"lc" #'cquery/callers
"ld" #'cquery/derived
"lR" #'cquery-freshen-index
"lv" #'cquery/vars
"l SPC" #'cquery/random
)) |
How does cquery behave when the |
@jacobdufault to answer this question. |
https://github.com/cquery-project/cquery is a low-latency language server supporting multi-million line C++ code-bases, powered by libclang. Please refer to https://github.com/cquery-project/cquery/wiki/Emacs
Hope it can be integrated in spacemacs soon. |
Reworked some of MaskRay's config into a a new PR for the lsp layer, here: And an attempt at a cquery layer here: I'll raise a new PR for the cquery layer if the lsp-layer one gets merged (it builds on it). |
tl;dr https://github.com/cquery-project/cquery/wiki/Emacs
https://www.reddit.com/r/emacs/comments/806mgw/recent_improvement_of_cquery_and_emacscquery/
cquery is a low-latency language server supporting multi-million line C++ code-bases, powered by libclang.
Since current c-c++ layer needs cleanup and I am not an experienced elisp or spacemacs user, I decide to put it into
+tools/
instead of+lang/c-c++/
. Another reason doing this is that cquery also supports Objective-C as libclang supports it, though probably with many issues because of the lack of Objective-C users 😜 Anyway, I hope more experienced user can move it into+lang/c-c++
or elsewhere that is appropriate.+tools/cquery depends on +tools/lsp, which is added in another PR #10211