Enable make* indexing by default

This commit is contained in:
Jacob Dufault 2018-01-31 20:21:16 -08:00
parent 8108de0cfa
commit a2c1cb4a83
2 changed files with 9 additions and 5 deletions

View File

@ -146,9 +146,13 @@ struct Config {
// - https://github.com/autozimu/LanguageClient-neovim/issues/224 // - https://github.com/autozimu/LanguageClient-neovim/issues/224
int comments = 2; int comments = 2;
// A hack to convert calls of make_shared/make_unique and other |Make| // Attempt to convert calls of make* functions to constructors based on
// variants to constructor calls. // hueristics.
bool make_unique = false; //
// For example, this will show constructor calls for std::make_unique
// invocations. Specifically, cquery will try to attribute a ctor call
// whenever the function name starts with make (ignoring case).
bool attributeMakeCallsToCtor = true;
}; };
Index index; Index index;
@ -159,7 +163,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, comments, make_unique); MAKE_REFLECT_STRUCT(Config::Index, comments, attributeMakeCallsToCtor);
MAKE_REFLECT_STRUCT(Config, MAKE_REFLECT_STRUCT(Config,
compilationDatabaseDirectory, compilationDatabaseDirectory,
cacheDirectory, cacheDirectory,

View File

@ -504,7 +504,7 @@ struct InitializeHandler : BaseMessageHandler<Ipc_InitializeRequest> {
} }
g_index_comments = config->index.comments; g_index_comments = config->index.comments;
g_index_make_unique = config->index.make_unique; g_index_make_unique = config->index.attributeMakeCallsToCtor;
if (config->cacheDirectory.empty()) { if (config->cacheDirectory.empty()) {
LOG_S(ERROR) << "cacheDirectory cannot be empty."; LOG_S(ERROR) << "cacheDirectory cannot be empty.";
exit(1); exit(1);