-
Notifications
You must be signed in to change notification settings - Fork 162
Initialization options
You need to configure your language client plugin to send initialization options to the cquery process (the language server). cacheDirectory
points to a directory storing indexing files so that next time cquery can load these indexing results without doing a re-index.
{
"initializationOptions": {
"cacheDirectory": "/tmp/cquery",
"cacheFormat": "msgpack",
"enableComments": 2
}
}
You can also pass options through the cquery command line option --init='{"enableComments": true}'
. VSCode:cquery.launch.args
, Emacs:cquery-additional-arguments
"enableComments": 0
"enableComments": 1 // index Doxygen comment markers
"enableComments": 2 // use -fparse-all-comments and recognize plain // /*
With the value larger than 0, cquery will index comments associated with functions/types/variables (macros are not handled due to clang_Cursor_getRawCommentText
's peculiarity).
This feature requires UI support as multi-line hover results poses a problem to editors:
- Visual Studio Code: good
- Emacs
- lsp-ui-doc https://github.com/emacs-lsp/lsp-ui
- lsp-mode eldoc See https://github.com/emacs-lsp/lsp-mode/pull/224
- Vim
- LanguageClient-neovim: 😢 https://github.com/autozimu/LanguageClient-neovim/issues/224
Two cache serialization formats are supported.
"cacheFormat": "json"
"cacheFormat": "msgpack"
"json"
generates cacheDirectory/.../xxx.json
files which can be pretty printed with jq.
"msgpack"
uses a compact binary serialization format (the underlying wire format is MessagePack) which typically takes only 60% of the corresponding JSON size, but is difficult to inspect.