plugins.lsp.servers.ccls.initOptions.index.comments

ccls can index the contents of comments associated with functions/types/variables (macros are not handled). This value controls how comments are indexed:

  • 0: don’t index comments
  • 1: index Doxygen comment markers
  • 2: use -fparse-all-comments and recognize plain // /* */ in addition to Doxygen comment markers

Type: null or one of 0, 1, 2 or raw lua code

Default: null

Plugin default: 2

Declared by:

plugins.lsp.servers.ccls.initOptions.index.initialBlacklist

A list of regular expressions matching files that should not be indexed when the ccls server starts up, but will still be indexed if a client opens them. If there are areas of the project that you have no interest in indexing you can use this to avoid it unless you visit those files.

This can also be set to match all files, which is helpful in avoiding massive parsing operations when performing quick edits on large projects.

Be aware that you will not have access to full cross-referencing information in this situation.

If index.initialWhitelist is also specified, the whitelist takes precedence.

Example: ["."] (matches all files)

Type: null or (list of string)

Default: null

Plugin default: []

Declared by:

plugins.lsp.servers.ccls.initOptions.index.multiVersion

Index a file only once (0), or in each translation unit that includes it (1).

The default is sensible for common usage: it reduces memory footprint. If both a.cc and b.cc include a.h, there is only one indexed version of a.h.

But for dependent name lookup, or references in headers that may change depending on other macros, etc, you may want to index a file multiple times to get every possible cross reference. In that case set the option to 1 but be aware that it may increase index file sizes significantly.

Also consider using index.multiVersionBlacklist to exclude system headers.

Type: null or one of 0, 1 or raw lua code

Default: null

Plugin default: 0

Declared by:

plugins.lsp.servers.ccls.initOptions.index.multiVersionBlacklist

A list of regular expressions matching files that should not be indexed via multi-version if index.multiVersion is set to 1.

Commonly this is used to avoid indexing system headers multiple times as this is seldom useful.

Example: ["^/usr/include"]

Type: null or (list of string)

Default: null

Plugin default: []

Declared by:

plugins.lsp.servers.ccls.initOptions.index.onChange

If false, a file is re-indexed when saved, updating the global index incrementally.

If set to true, a document is re-indexed for every (unsaved) change. Performance may suffer, but it is convenient for playground projects. Generally this is best used in conjunction with empty cache.directory to avoid writing cache files to disk.

Type: null or boolean or raw lua code

Default: null

Plugin default: false

Declared by:

plugins.lsp.servers.ccls.initOptions.index.threads

How many threads to start when indexing a project. 0 means use std::thread::hardware_concurrency() (the number of cores the system has). If you want to reduce peak CPU and memory usage, set it to a small integer.

Type: null or signed integer or floating point number or raw lua code

Default: null

Plugin default: 0

Declared by:

plugins.lsp.servers.ccls.initOptions.index.trackDependency

Determine whether a file should be re-indexed when any of its dependencies changes timestamp.

If a.h has been changed, when you open a.cc which includes a.h then if trackDependency is:

  • 0: no re-indexing unless a.cc itself changes timestamp.
  • 2: the index of a.cc is considered stale and it should be re-indexed.
  • 1: before the initial load, the behavior of 2 is used, otherwise the behavior of 0 is used.

Type: null or one of 0, 1, 2 or raw lua code

Default: null

Plugin default: 2

Declared by: