From 31d7423490f03d1b1b6ad5bd2612b227858a608c Mon Sep 17 00:00:00 2001 From: Walter Erquinigo Date: Tue, 21 Nov 2017 23:24:39 -0800 Subject: [PATCH] Rebuild vscode plugin and fix some naming --- src/project.cc | 20 ++++++++++---------- src/project.h | 10 +++++----- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/src/project.cc b/src/project.cc index 0b7a23ae..1c52ff93 100644 --- a/src/project.cc +++ b/src/project.cc @@ -230,18 +230,18 @@ std::vector LoadFromDirectoryListing(ProjectConfig* config) { std::vector LoadCompilationEntriesFromDirectory( ProjectConfig* config, - const std::string& compilationDatabaseDirectory) { + const std::string& opt_compilation_db_dir) { // Try to load compile_commands.json, but fallback to a project listing. - const auto& compilationDbDir = compilationDatabaseDirectory.empty() - ? config->project_dir - : compilationDatabaseDirectory; + const auto& compilation_db_dir = opt_compilation_db_dir.empty() + ? config->project_dir + : opt_compilation_db_dir; LOG_S(INFO) << "Trying to load compile_commands.json"; CXCompilationDatabase_Error cx_db_load_error; CXCompilationDatabase cx_db = clang_CompilationDatabase_fromDirectory( - compilationDbDir.c_str(), &cx_db_load_error); + compilation_db_dir.c_str(), &cx_db_load_error); if (cx_db_load_error == CXCompilationDatabase_CanNotLoadDatabase) { LOG_S(INFO) << "Unable to load compile_commands.json located at \"" - << compilationDbDir + << compilation_db_dir << "\"; using directory listing instead."; return LoadFromDirectoryListing(config); } @@ -343,16 +343,16 @@ int ComputeGuessScore(const std::string& a, const std::string& b) { } // namespace void Project::Load(const std::vector& extra_flags, - const std::string& compilationDatabaseDirectory, - const std::string& rootDirectory, + const std::string& opt_compilation_db_dir, + const std::string& root_directory, const std::string& resource_directory) { // Load data. ProjectConfig config; config.extra_flags = extra_flags; - config.project_dir = rootDirectory; + config.project_dir = root_directory; config.resource_dir = resource_directory; entries = LoadCompilationEntriesFromDirectory(&config, - compilationDatabaseDirectory); + opt_compilation_db_dir); // Cleanup / postprocess include directories. quote_include_directories.assign(config.quote_dirs.begin(), diff --git a/src/project.h b/src/project.h index c243502e..00bbb892 100644 --- a/src/project.h +++ b/src/project.h @@ -31,15 +31,15 @@ struct Project { // Loads a project for the given |directory|. // - // If |compilationDatabaseDirectory| is not empty, the compile_commands.json + // If |opt_compilation_db_dir| is not empty, the compile_commands.json // file in it will be used to discover all files and args. If it's empty and - // |directory| contains a compile_commands.json file, that one will be used + // |root_directory| contains a compile_commands.json file, that one will be used // instead. Otherwise, a recursive directory listing of all *.cpp, *.cc, *.h, // and *.hpp files will be used. clang arguments can be specified in a - // clang_args file located inside of |directory|. + // clang_args file located inside of |root_directory|. void Load(const std::vector& extra_flags, - const std::string& compilationDatabaseDirectory, - const std::string& rootDirectory, + const std::string& opt_compilation_db_dir, + const std::string& root_directory, const std::string& resource_directory); // Lookup the CompilationEntry for |filename|. If no entry was found this