Remove index.builtinTypes and fix doc

This commit is contained in:
Fangrui Song 2018-01-30 09:04:01 -08:00
parent ab2a836d57
commit 5d88eb959d

View File

@ -5,20 +5,20 @@
#include <string> #include <string>
/* /*
The language client plugin needs to send some initialization options to the The language client plugin needs to send initialization options in the
cquery language server. The only required option is cacheDirectory, which is `initialize` request to the cquery language server. The only required option is
where index files will be stored. `cacheDirectory`, which is where index files will be stored.
{ {
"initializationOptions": { "initializationOptions": {
"cacheDirectory": "/tmp/cquery", "cacheDirectory": "/tmp/cquery"
} }
} }
If necessary, these options can also be passed via the command line option If necessary, the command line option --init can be used to override
--init, for example, initialization options specified by the client. For example, in shell syntax:
--init='{"enableComments": 2}' '--init={"indexWhitelist": ["."], "index": {"comments": 2}}'
*/ */
struct Config { struct Config {
// Root directory of the project. **Not available for configuration** // Root directory of the project. **Not available for configuration**
@ -51,15 +51,12 @@ struct Config {
// Additional arguments to pass to clang. // Additional arguments to pass to clang.
std::vector<std::string> extraClangArguments; std::vector<std::string> extraClangArguments;
// If a translation unit's absolute path matches any EMCAScript regex in this // If a translation unit's absolute path matches any EMCAScript regex in the
// list, it will be indexed. The whitelist takes priority over the blacklist. // whitelist, or does not match any regex in the blacklist, it will be indexed.
// To only index files in the whitelist, make indexBlacklist match // To only index files in the whitelist, add ".*" to the blacklist.
// everything, ie, set it to ".*". // `std::regex_search(path, regex, std::regex_constants::match_any)`
// //
// You probably want to begin the regex using .* because the passed paths are // Example: `ash/.*\.cc`
// absolute.
//
// Example: .*/ash/*
std::vector<std::string> indexWhitelist; std::vector<std::string> indexWhitelist;
std::vector<std::string> indexBlacklist; std::vector<std::string> indexBlacklist;
// If true, project paths that were skipped by the whitelist/blacklist will // If true, project paths that were skipped by the whitelist/blacklist will
@ -141,8 +138,6 @@ struct Config {
Completion completion; Completion completion;
struct Index { struct Index {
bool builtinTypes = false;
// 0: none, 1: doxygen, 2: all comments // 0: none, 1: doxygen, 2: all comments
// Plugin support for clients: // Plugin support for clients:
// - https://github.com/emacs-lsp/lsp-ui // - https://github.com/emacs-lsp/lsp-ui
@ -159,7 +154,7 @@ struct Config {
}; };
MAKE_REFLECT_STRUCT(Config::ClientCapability, snippetSupport); MAKE_REFLECT_STRUCT(Config::ClientCapability, snippetSupport);
MAKE_REFLECT_STRUCT(Config::Completion, filterAndSort); MAKE_REFLECT_STRUCT(Config::Completion, filterAndSort);
MAKE_REFLECT_STRUCT(Config::Index, builtinTypes, comments); MAKE_REFLECT_STRUCT(Config::Index, comments);
MAKE_REFLECT_STRUCT(Config, MAKE_REFLECT_STRUCT(Config,
compilationDatabaseDirectory, compilationDatabaseDirectory,
cacheDirectory, cacheDirectory,