Skip to content
This repository has been archived by the owner on Jul 30, 2020. It is now read-only.

Initialization options

Fangrui Song edited this page Jan 9, 2018 · 26 revisions

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 cannot load these indexing results without doing a re-index.

{
  "initializationOptions": {
    "cacheDirectory": "/tmp/cquery",
    "cacheFormat": "msgpack",
    "enableComments": true
  }
}

You can also pass options through the cquery command line option --init='{"enableComments": true}'. VSCode:cquery.launch.args, Emacs:cquery-additional-arguments

Indexing comments

"enableComments": true`

With the option set, cquery will index comments associated with functions/types/variables (macros are not handled due to clang_Cursor_getRawCommentText's peculiarity).

Certain comment markers /** /// //! (e.g. Doxygen) are processed by default. /* // are also recognized because cquery uses -fparse-all-comments in the clang command line.

This feature requires UI support as it is easy to get multi-line hover results.

Cache format

Two choices are supported.

"cacheFormat": "json"
"cacheFormat": "msgpack"

"json" generates cacheDirectory/.../xxx.json file can be pretty printed with jq.

"msgpack" uses a compact binary serialization format (based on MessagePack) which typically takes only 60% of the corresponding JSON size, but is difficult to inspect.