From 702cdbe9bbb56845013f040a3028ab69d40f938e Mon Sep 17 00:00:00 2001 From: Fangrui Song Date: Wed, 21 Feb 2018 21:50:36 -0800 Subject: [PATCH] Group initialization options and rename $cquery/typeHierarchyTree to $cquery/inheritanceHierarchy --- src/command_line.cc | 2 +- src/config.h | 190 +++++++++--------- src/import_pipeline.cc | 2 +- src/include_complete.cc | 18 +- src/indexer.cc | 2 +- src/ipc.cc | 4 +- src/ipc.h | 2 +- ...ree.cc => cquery_inheritance_hierarchy.cc} | 54 ++--- src/messages/initialize.cc | 12 +- src/messages/text_document_code_lens.cc | 2 +- src/messages/workspace_symbol.cc | 12 +- src/project.cc | 4 +- 12 files changed, 153 insertions(+), 151 deletions(-) rename src/messages/{cquery_type_hierarchy_tree.cc => cquery_inheritance_hierarchy.cc} (75%) diff --git a/src/command_line.cc b/src/command_line.cc index 5be17f38..c34d5fb7 100644 --- a/src/command_line.cc +++ b/src/command_line.cc @@ -332,7 +332,7 @@ void LaunchStdinLoop(Config* config, case IpcId::WorkspaceSymbol: case IpcId::CqueryFileInfo: case IpcId::CqueryFreshenIndex: - case IpcId::CqueryTypeHierarchyTree: + case IpcId::CqueryInheritanceHierarchy: case IpcId::CqueryCallTreeInitial: case IpcId::CqueryCallTreeExpand: case IpcId::CqueryMemberHierarchyInitial: diff --git a/src/config.h b/src/config.h index f52ac86e..900da7e3 100644 --- a/src/config.h +++ b/src/config.h @@ -18,7 +18,7 @@ The language client plugin needs to send initialization options in the If necessary, the command line option --init can be used to override initialization options specified by the client. For example, in shell syntax: - '--init={"indexWhitelist": ["."], "index": {"comments": 2}}' + '--init={"index": {"comments": 2, "whitelist": ["."]}}' */ struct Config { // Root directory of the project. **Not available for configuration** @@ -56,31 +56,6 @@ struct Config { // Additional arguments to pass to clang. std::vector extraClangArguments; - // If a translation unit's absolute path matches any EMCAScript regex in the - // whitelist, or does not match any regex in the blacklist, it will be indexed. - // To only index files in the whitelist, add ".*" to the blacklist. - // `std::regex_search(path, regex, std::regex_constants::match_any)` - // - // Example: `ash/.*\.cc` - std::vector indexWhitelist; - std::vector indexBlacklist; - // If true, project paths that were skipped by the whitelist/blacklist will - // be logged. - bool logSkippedPathsForIndex = false; - - // Maximum workspace search results. - int maxWorkspaceSearchResults = 500; - // If true, workspace search results will be dynamically rescored/reordered - // as the search progresses. Some clients do their own ordering and assume - // that the results stay sorted in the same order as the search progresses. - bool sortWorkspaceSearchResults = true; - - // Force a certain number of indexer threads. If less than 1 a default value - // is be used (80% number of CPU cores). - int indexerCount = 0; - // If false, the indexer will be disabled. - bool enableIndexing = true; - // If true, cquery will send progress reports while indexing // How often should cquery send progress report messages? // -1: never @@ -97,31 +72,8 @@ struct Config { // If true, document links are reported for #include directives. bool showDocumentLinksOnIncludes = true; - // Maximum path length to show in completion results. Paths longer than this - // will be elided with ".." put at the front. Set to 0 or a negative number - // to disable eliding. - int includeCompletionMaximumPathLength = 30; - // Whitelist that file paths will be tested against. If a file path does not - // end in one of these values, it will not be considered for auto-completion. - // An example value is { ".h", ".hpp" } - // - // This is significantly faster than using a regex. - std::vector includeCompletionWhitelistLiteralEnding = { - ".h", ".hpp", ".hh"}; - // Regex patterns to match include completion candidates against. They - // receive the absolute file path. - // - // For example, to hide all files in a /CACHE/ folder, use ".*/CACHE/.*" - std::vector includeCompletionWhitelist; - std::vector includeCompletionBlacklist; - // If true, diagnostics from a full document parse will be reported. bool diagnosticsOnParse = true; - // If true, diagnostics from code completion will be reported. - bool diagnosticsOnCodeCompletion = true; - - // Enables code lens on parameter and function variables. - bool codeLensOnLocalVariables = true; // Version of the client. If undefined the version check is skipped. Used to // inform users their vscode client is too old and needs to be updated. @@ -133,14 +85,12 @@ struct Config { }; ClientCapability client; - struct Completion { - // If true, filter and sort completion response. cquery filters and sorts - // completions to try to be nicer to clients that can't handle big numbers - // of completion candidates. This behaviour can be disabled by specifying - // false for the option. This option is the most useful for LSP clients - // that implement their own filtering and sorting logic. - bool filterAndSort = true; + struct CodeLens { + // Enables code lens on parameter and function variables. + bool localVariables = true; + } codeLens; + struct Completion { // Some completion UI, such as Emacs' completion-at-point and company-lsp, // display completion item label and detail side by side. // This does not look right, when you see things like: @@ -159,25 +109,36 @@ struct Config { // Be wary, this is quickly quite verbose, // items can end up truncated by the UIs. bool detailedLabel = false; - }; - Completion completion; - struct Xref { - // If true, |Location[]| response will include lexical container. - bool container = false; - // Maximum number of definition/reference/... results. - int maxNum = 300; - }; - Xref xref; + // If true, filter and sort completion response. cquery filters and sorts + // completions to try to be nicer to clients that can't handle big numbers + // of completion candidates. This behaviour can be disabled by specifying + // false for the option. This option is the most useful for LSP clients + // that implement their own filtering and sorting logic. + bool filterAndSort = true; + + // Regex patterns to match include completion candidates against. They + // receive the absolute file path. + // + // For example, to hide all files in a /CACHE/ folder, use ".*/CACHE/.*" + std::vector includeBlacklist; + + // Maximum path length to show in completion results. Paths longer than this + // will be elided with ".." put at the front. Set to 0 or a negative number + // to disable eliding. + int includeMaxPathSize = 30; + + // Whitelist that file paths will be tested against. If a file path does not + // end in one of these values, it will not be considered for auto-completion. + // An example value is { ".h", ".hpp" } + // + // This is significantly faster than using a regex. + std::vector includeSuffixWhitelist = {".h", ".hpp", ".hh"}; + + std::vector includeWhitelist; + } completion; struct Index { - // 0: none, 1: doxygen, 2: all comments - // Plugin support for clients: - // - https://github.com/emacs-lsp/lsp-ui - // - https://github.com/emacs-lsp/lsp-mode/pull/224 - // - https://github.com/autozimu/LanguageClient-neovim/issues/224 - int comments = 2; - // Attempt to convert calls of make* functions to constructors based on // hueristics. // @@ -185,8 +146,49 @@ struct Config { // invocations. Specifically, cquery will try to attribute a ctor call // whenever the function name starts with make (ignoring case). bool attributeMakeCallsToCtor = true; - }; - Index index; + + // If a translation unit's absolute path matches any EMCAScript regex in the + // whitelist, or does not match any regex in the blacklist, it will be indexed. + // To only index files in the whitelist, add ".*" to the blacklist. + // `std::regex_search(path, regex, std::regex_constants::match_any)` + // + // Example: `ash/.*\.cc` + std::vector blacklist; + + // 0: none, 1: Doxygen, 2: all comments + // Plugin support for clients: + // - https://github.com/emacs-lsp/lsp-ui + // - https://github.com/autozimu/LanguageClient-neovim/issues/224 + int comments = 2; + + // If false, the indexer will be disabled. + bool enabled = true; + + // If true, project paths that were skipped by the whitelist/blacklist will + // be logged. + bool logSkippedPaths = false; + + // Number of indexer threads. If 0, 80% of cores are used. + int threads = 0; + + std::vector whitelist; + } index; + + struct WorkspaceSymbol { + // Maximum workspace search results. + int maxNum = 1000; + // If true, workspace search results will be dynamically rescored/reordered + // as the search progresses. Some clients do their own ordering and assume + // that the results stay sorted in the same order as the search progresses. + bool sort = true; + } workspaceSymbol; + + struct Xref { + // If true, |Location[]| response will include lexical container. + bool container = false; + // Maximum number of definition/reference/... results. + int maxNum = 2000; + } xref; //// For debugging @@ -194,9 +196,24 @@ struct Config { std::vector dumpAST; }; MAKE_REFLECT_STRUCT(Config::ClientCapability, snippetSupport); -MAKE_REFLECT_STRUCT(Config::Completion, filterAndSort, detailedLabel); +MAKE_REFLECT_STRUCT(Config::CodeLens, localVariables); +MAKE_REFLECT_STRUCT(Config::Completion, + detailedLabel, + filterAndSort, + includeBlacklist, + includeMaxPathSize, + includeSuffixWhitelist, + includeWhitelist); +MAKE_REFLECT_STRUCT(Config::Index, + attributeMakeCallsToCtor, + blacklist, + comments, + enabled, + logSkippedPaths, + threads, + whitelist); +MAKE_REFLECT_STRUCT(Config::WorkspaceSymbol, maxNum, sort); MAKE_REFLECT_STRUCT(Config::Xref, container, maxNum); -MAKE_REFLECT_STRUCT(Config::Index, comments, attributeMakeCallsToCtor); MAKE_REFLECT_STRUCT(Config, compilationDatabaseCommand, compilationDatabaseDirectory, @@ -206,35 +223,20 @@ MAKE_REFLECT_STRUCT(Config, extraClangArguments, - indexWhitelist, - indexBlacklist, - logSkippedPathsForIndex, - - maxWorkspaceSearchResults, - sortWorkspaceSearchResults, - - indexerCount, - enableIndexing, progressReportFrequencyMs, - includeCompletionMaximumPathLength, - includeCompletionWhitelistLiteralEnding, - includeCompletionWhitelist, - includeCompletionBlacklist, - showDocumentLinksOnIncludes, diagnosticsOnParse, - diagnosticsOnCodeCompletion, - - codeLensOnLocalVariables, clientVersion, client, + codeLens, completion, - xref, index, + workspaceSymbol, + xref, dumpAST); diff --git a/src/import_pipeline.cc b/src/import_pipeline.cc index 81fe7d1d..46161936 100644 --- a/src/import_pipeline.cc +++ b/src/import_pipeline.cc @@ -352,7 +352,7 @@ void ParseFile(Config* config, entry.args, file_contents, &perf); if (!indexes) { - if (config->enableIndexing && + if (config->index.enabled && !std::holds_alternative(request.id)) { Out_Error out; out.id = request.id; diff --git a/src/include_complete.cc b/src/include_complete.cc index cadc2fd3..c1527b22 100644 --- a/src/include_complete.cc +++ b/src/include_complete.cc @@ -17,13 +17,13 @@ struct CompletionCandidate { }; std::string ElideLongPath(Config* config, const std::string& path) { - if (config->includeCompletionMaximumPathLength <= 0) + if (config->completion.includeMaxPathSize <= 0) return path; - if ((int)path.size() <= config->includeCompletionMaximumPathLength) + if ((int)path.size() <= config->completion.includeMaxPathSize) return path; - size_t start = path.size() - config->includeCompletionMaximumPathLength; + size_t start = path.size() - config->completion.includeMaxPathSize; return ".." + path.substr(start + 2); } @@ -110,10 +110,10 @@ void IncludeComplete::Rescan() { absolute_path_to_completion_item.clear(); inserted_paths.clear(); - if (!match_ && (!config_->includeCompletionWhitelist.empty() || - !config_->includeCompletionBlacklist.empty())) - match_ = MakeUnique(config_->includeCompletionWhitelist, - config_->includeCompletionBlacklist); + if (!match_ && (!config_->completion.includeWhitelist.empty() || + !config_->completion.includeBlacklist.empty())) + match_ = MakeUnique(config_->completion.includeWhitelist, + config_->completion.includeBlacklist); is_scanning = true; WorkThread::StartThread("scan_includes", [this]() { @@ -151,7 +151,7 @@ void IncludeComplete::InsertCompletionItem(const std::string& absolute_path, void IncludeComplete::AddFile(const std::string& absolute_path) { if (!EndsWithAny(absolute_path, - config_->includeCompletionWhitelistLiteralEnding)) + config_->completion.includeSuffixWhitelist)) return; if (match_ && !match_->IsMatch(absolute_path)) return; @@ -184,7 +184,7 @@ void IncludeComplete::InsertIncludesFromDirectory(std::string directory, directory, true /*recursive*/, false /*add_folder_to_path*/, [&](const std::string& path) { if (!EndsWithAny(path, - config_->includeCompletionWhitelistLiteralEnding)) + config_->completion.includeSuffixWhitelist)) return; if (match_ && !match_->IsMatch(directory + path)) return; diff --git a/src/indexer.cc b/src/indexer.cc index e10f9037..97f822fc 100644 --- a/src/indexer.cc +++ b/src/indexer.cc @@ -2195,7 +2195,7 @@ optional>> Parse( PerformanceImportFile* perf, ClangIndex* index, bool dump_ast) { - if (!config->enableIndexing) + if (!config->index.enabled) return nullopt; file = NormalizePath(file); diff --git a/src/ipc.cc b/src/ipc.cc index 8fff915b..0856d384 100644 --- a/src/ipc.cc +++ b/src/ipc.cc @@ -70,8 +70,8 @@ const char* IpcIdToString(IpcId id) { return "$cquery/fileInfo"; case IpcId::CqueryFreshenIndex: return "$cquery/freshenIndex"; - case IpcId::CqueryTypeHierarchyTree: - return "$cquery/typeHierarchyTree"; + case IpcId::CqueryInheritanceHierarchy: + return "$cquery/inheritanceHierarchy"; case IpcId::CqueryCallTreeInitial: return "$cquery/callTreeInitial"; case IpcId::CqueryCallTreeExpand: diff --git a/src/ipc.h b/src/ipc.h index ffc8be20..e902e0b8 100644 --- a/src/ipc.h +++ b/src/ipc.h @@ -48,7 +48,7 @@ enum class IpcId : int { CqueryFileInfo, CqueryFreshenIndex, // Messages used in tree views. - CqueryTypeHierarchyTree, + CqueryInheritanceHierarchy, CqueryCallTreeInitial, CqueryCallTreeExpand, CqueryMemberHierarchyInitial, diff --git a/src/messages/cquery_type_hierarchy_tree.cc b/src/messages/cquery_inheritance_hierarchy.cc similarity index 75% rename from src/messages/cquery_type_hierarchy_tree.cc rename to src/messages/cquery_inheritance_hierarchy.cc index 4f4376fe..9dee8691 100644 --- a/src/messages/cquery_type_hierarchy_tree.cc +++ b/src/messages/cquery_inheritance_hierarchy.cc @@ -3,16 +3,16 @@ #include "queue_manager.h" namespace { -struct Ipc_CqueryTypeHierarchyTree - : public RequestMessage { - const static IpcId kIpcId = IpcId::CqueryTypeHierarchyTree; +struct Ipc_CqueryInheritanceHierarchy + : public RequestMessage { + const static IpcId kIpcId = IpcId::CqueryInheritanceHierarchy; lsTextDocumentPositionParams params; }; -MAKE_REFLECT_STRUCT(Ipc_CqueryTypeHierarchyTree, id, params); -REGISTER_IPC_MESSAGE(Ipc_CqueryTypeHierarchyTree); +MAKE_REFLECT_STRUCT(Ipc_CqueryInheritanceHierarchy, id, params); +REGISTER_IPC_MESSAGE(Ipc_CqueryInheritanceHierarchy); -struct Out_CqueryTypeHierarchyTree - : public lsOutMessage { +struct Out_CqueryInheritanceHierarchy + : public lsOutMessage { struct TypeEntry { std::string_view name; optional location; @@ -21,22 +21,22 @@ struct Out_CqueryTypeHierarchyTree lsRequestId id; optional result; }; -MAKE_REFLECT_STRUCT(Out_CqueryTypeHierarchyTree::TypeEntry, +MAKE_REFLECT_STRUCT(Out_CqueryInheritanceHierarchy::TypeEntry, name, location, children); -MAKE_REFLECT_STRUCT(Out_CqueryTypeHierarchyTree, jsonrpc, id, result); +MAKE_REFLECT_STRUCT(Out_CqueryInheritanceHierarchy, jsonrpc, id, result); -std::vector +std::vector BuildParentInheritanceHierarchyForType(QueryDatabase* db, WorkingFiles* working_files, QueryType& root_type) { - std::vector parent_entries; + std::vector parent_entries; const QueryType::Def* def = root_type.AnyDef(); parent_entries.reserve(def->parents.size()); EachDefinedEntity(db->types, def->parents, [&](QueryType& parent_type) { - Out_CqueryTypeHierarchyTree::TypeEntry parent_entry; + Out_CqueryInheritanceHierarchy::TypeEntry parent_entry; const QueryType::Def* def1 = parent_type.AnyDef(); parent_entry.name = def1->detailed_name.c_str(); if (def1->spell) @@ -50,11 +50,11 @@ BuildParentInheritanceHierarchyForType(QueryDatabase* db, return parent_entries; } -optional +optional BuildInheritanceHierarchyForType(QueryDatabase* db, WorkingFiles* working_files, QueryType& root_type) { - Out_CqueryTypeHierarchyTree::TypeEntry entry; + Out_CqueryInheritanceHierarchy::TypeEntry entry; const QueryType::Def* def = root_type.AnyDef(); // Name and location. @@ -65,7 +65,7 @@ BuildInheritanceHierarchyForType(QueryDatabase* db, entry.children.reserve(root_type.derived.size()); // Base types. - Out_CqueryTypeHierarchyTree::TypeEntry base; + Out_CqueryInheritanceHierarchy::TypeEntry base; base.name = "[[Base]]"; base.location = entry.location; base.children = @@ -84,11 +84,11 @@ BuildInheritanceHierarchyForType(QueryDatabase* db, return entry; } -std::vector +std::vector BuildParentInheritanceHierarchyForFunc(QueryDatabase* db, WorkingFiles* working_files, QueryFuncId root) { - std::vector entries; + std::vector entries; QueryFunc& root_func = db->funcs[root.id]; const QueryFunc::Def* def = root_func.AnyDef(); @@ -101,7 +101,7 @@ BuildParentInheritanceHierarchyForFunc(QueryDatabase* db, if (!def1) continue; - Out_CqueryTypeHierarchyTree::TypeEntry parent_entry; + Out_CqueryInheritanceHierarchy::TypeEntry parent_entry; parent_entry.name = def1->detailed_name; if (def1->spell) parent_entry.location = GetLsLocation(db, working_files, *def1->spell); @@ -114,7 +114,7 @@ BuildParentInheritanceHierarchyForFunc(QueryDatabase* db, return entries; } -optional +optional BuildInheritanceHierarchyForFunc(QueryDatabase* db, WorkingFiles* working_files, QueryFuncId root_id) { @@ -123,7 +123,7 @@ BuildInheritanceHierarchyForFunc(QueryDatabase* db, if (!def) return nullopt; - Out_CqueryTypeHierarchyTree::TypeEntry entry; + Out_CqueryInheritanceHierarchy::TypeEntry entry; // Name and location. entry.name = def->detailed_name; @@ -134,7 +134,7 @@ BuildInheritanceHierarchyForFunc(QueryDatabase* db, entry.children.reserve(root_func.derived.size()); // Base types. - Out_CqueryTypeHierarchyTree::TypeEntry base; + Out_CqueryInheritanceHierarchy::TypeEntry base; base.name = "[[Base]]"; base.location = entry.location; base.children = @@ -153,9 +153,9 @@ BuildInheritanceHierarchyForFunc(QueryDatabase* db, return entry; } -struct CqueryTypeHierarchyTreeHandler - : BaseMessageHandler { - void Run(Ipc_CqueryTypeHierarchyTree* request) override { +struct CqueryInheritanceHierarchyHandler + : BaseMessageHandler { + void Run(Ipc_CqueryInheritanceHierarchy* request) override { QueryFile* file; if (!FindFileOrFail(db, project, request->id, request->params.textDocument.uri.GetPath(), &file)) @@ -164,7 +164,7 @@ struct CqueryTypeHierarchyTreeHandler WorkingFile* working_file = working_files->GetFileByFilename(file->def->path); - Out_CqueryTypeHierarchyTree out; + Out_CqueryInheritanceHierarchy out; out.id = request->id; for (const SymbolRef& sym : @@ -183,8 +183,8 @@ struct CqueryTypeHierarchyTreeHandler } } - QueueManager::WriteStdout(IpcId::CqueryTypeHierarchyTree, out); + QueueManager::WriteStdout(IpcId::CqueryInheritanceHierarchy, out); } }; -REGISTER_MESSAGE_HANDLER(CqueryTypeHierarchyTreeHandler); +REGISTER_MESSAGE_HANDLER(CqueryInheritanceHierarchyHandler); } // namespace diff --git a/src/messages/initialize.cc b/src/messages/initialize.cc index 6dd2f4ab..4e5efec6 100644 --- a/src/messages/initialize.cc +++ b/src/messages/initialize.cc @@ -590,17 +590,17 @@ struct InitializeHandler : BaseMessageHandler { // Start indexer threads. Start this after loading the project, as that // may take a long time. Indexer threads will emit status/progress // reports. - if (config->indexerCount == 0) { + if (config->index.threads == 0) { // If the user has not specified how many indexers to run, try to // guess an appropriate value. Default to 80% utilization. const float kDefaultTargetUtilization = 0.8f; - config->indexerCount = (int)(std::thread::hardware_concurrency() * + config->index.threads = (int)(std::thread::hardware_concurrency() * kDefaultTargetUtilization); - if (config->indexerCount <= 0) - config->indexerCount = 1; + if (config->index.threads <= 0) + config->index.threads = 1; } - LOG_S(INFO) << "Starting " << config->indexerCount << " indexers"; - for (int i = 0; i < config->indexerCount; ++i) { + LOG_S(INFO) << "Starting " << config->index.threads << " indexers"; + for (int i = 0; i < config->index.threads; ++i) { WorkThread::StartThread("indexer" + std::to_string(i), [=]() { Indexer_Main(config, file_consumer_shared, timestamp_manager, import_manager, import_pipeline_status, project, diff --git a/src/messages/text_document_code_lens.cc b/src/messages/text_document_code_lens.cc index 8c950d62..d9e91a11 100644 --- a/src/messages/text_document_code_lens.cc +++ b/src/messages/text_document_code_lens.cc @@ -246,7 +246,7 @@ struct TextDocumentCodeLensHandler case SymbolKind::Var: { QueryVar& var = db->GetVar(sym); const QueryVar::Def* def = var.AnyDef(); - if (!def || (def->is_local() && !config->codeLensOnLocalVariables)) + if (!def || (def->is_local() && !config->codeLens.localVariables)) continue; bool force_display = true; diff --git a/src/messages/workspace_symbol.cc b/src/messages/workspace_symbol.cc index 5fcfec5d..720abd2f 100644 --- a/src/messages/workspace_symbol.cc +++ b/src/messages/workspace_symbol.cc @@ -76,8 +76,8 @@ struct WorkspaceSymbolHandler : BaseMessageHandler { // db->detailed_names indices of each lsSymbolInformation in out.result std::vector result_indices; std::vector unsorted_results; - inserted_results.reserve(config->maxWorkspaceSearchResults); - result_indices.reserve(config->maxWorkspaceSearchResults); + inserted_results.reserve(config->workspaceSymbol.maxNum); + result_indices.reserve(config->workspaceSymbol.maxNum); // We use detailed_names without parameters for matching. @@ -92,14 +92,14 @@ struct WorkspaceSymbolHandler : BaseMessageHandler { if (InsertSymbolIntoResult(db, working_files, db->symbols[i], &unsorted_results)) { result_indices.push_back(i); - if (unsorted_results.size() >= config->maxWorkspaceSearchResults) + if (unsorted_results.size() >= config->workspaceSymbol.maxNum) break; } } } // Find subsequence matches. - if (unsorted_results.size() < config->maxWorkspaceSearchResults) { + if (unsorted_results.size() < config->workspaceSymbol.maxNum) { std::string query_without_space; query_without_space.reserve(query.size()); for (char c : query) @@ -116,14 +116,14 @@ struct WorkspaceSymbolHandler : BaseMessageHandler { if (InsertSymbolIntoResult(db, working_files, db->symbols[i], &unsorted_results)) { result_indices.push_back(i); - if (unsorted_results.size() >= config->maxWorkspaceSearchResults) + if (unsorted_results.size() >= config->workspaceSymbol.maxNum) break; } } } } - if (config->sortWorkspaceSearchResults) { + if (config->workspaceSymbol.sort) { // Sort results with a fuzzy matching algorithm. int longest = 0; for (int i : result_indices) diff --git a/src/project.cc b/src/project.cc index 4c93474d..7ab30ead 100644 --- a/src/project.cc +++ b/src/project.cc @@ -598,14 +598,14 @@ Project::Entry Project::FindCompilationEntryForFile( void Project::ForAllFilteredFiles( Config* config, std::function action) { - GroupMatch matcher(config->indexWhitelist, config->indexBlacklist); + GroupMatch matcher(config->index.whitelist, config->index.blacklist); for (int i = 0; i < entries.size(); ++i) { const Project::Entry& entry = entries[i]; std::string failure_reason; if (matcher.IsMatch(entry.filename, &failure_reason)) action(i, entries[i]); else { - if (config->logSkippedPathsForIndex) { + if (config->index.logSkippedPaths) { LOG_S(INFO) << "[" << i + 1 << "/" << entries.size() << "]: Failed " << failure_reason << "; skipping " << entry.filename; }