From a2c1cb4a832ce37e37fee569a478936533dff962 Mon Sep 17 00:00:00 2001 From: Jacob Dufault Date: Wed, 31 Jan 2018 20:21:16 -0800 Subject: [PATCH] Enable make* indexing by default --- src/config.h | 12 ++++++++---- src/messages/initialize.cc | 2 +- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/config.h b/src/config.h index 3e5f4ab6..5d86aa8d 100644 --- a/src/config.h +++ b/src/config.h @@ -146,9 +146,13 @@ struct Config { // - https://github.com/autozimu/LanguageClient-neovim/issues/224 int comments = 2; - // A hack to convert calls of make_shared/make_unique and other |Make| - // variants to constructor calls. - bool make_unique = false; + // Attempt to convert calls of make* functions to constructors based on + // hueristics. + // + // 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; @@ -159,7 +163,7 @@ struct Config { }; MAKE_REFLECT_STRUCT(Config::ClientCapability, snippetSupport); 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, compilationDatabaseDirectory, cacheDirectory, diff --git a/src/messages/initialize.cc b/src/messages/initialize.cc index e7e186d9..67bbd4c7 100644 --- a/src/messages/initialize.cc +++ b/src/messages/initialize.cc @@ -504,7 +504,7 @@ struct InitializeHandler : BaseMessageHandler { } 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()) { LOG_S(ERROR) << "cacheDirectory cannot be empty."; exit(1);