Rebuild vscode plugin and fix some naming

This commit is contained in:
Walter Erquinigo 2017-11-21 23:24:39 -08:00 committed by Jacob Dufault
parent 3cee3cb775
commit 31d7423490
2 changed files with 15 additions and 15 deletions

View File

@ -230,18 +230,18 @@ std::vector<Project::Entry> LoadFromDirectoryListing(ProjectConfig* config) {
std::vector<Project::Entry> LoadCompilationEntriesFromDirectory( std::vector<Project::Entry> LoadCompilationEntriesFromDirectory(
ProjectConfig* config, 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. // Try to load compile_commands.json, but fallback to a project listing.
const auto& compilationDbDir = compilationDatabaseDirectory.empty() const auto& compilation_db_dir = opt_compilation_db_dir.empty()
? config->project_dir ? config->project_dir
: compilationDatabaseDirectory; : opt_compilation_db_dir;
LOG_S(INFO) << "Trying to load compile_commands.json"; LOG_S(INFO) << "Trying to load compile_commands.json";
CXCompilationDatabase_Error cx_db_load_error; CXCompilationDatabase_Error cx_db_load_error;
CXCompilationDatabase cx_db = clang_CompilationDatabase_fromDirectory( 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) { if (cx_db_load_error == CXCompilationDatabase_CanNotLoadDatabase) {
LOG_S(INFO) << "Unable to load compile_commands.json located at \"" LOG_S(INFO) << "Unable to load compile_commands.json located at \""
<< compilationDbDir << compilation_db_dir
<< "\"; using directory listing instead."; << "\"; using directory listing instead.";
return LoadFromDirectoryListing(config); return LoadFromDirectoryListing(config);
} }
@ -343,16 +343,16 @@ int ComputeGuessScore(const std::string& a, const std::string& b) {
} // namespace } // namespace
void Project::Load(const std::vector<std::string>& extra_flags, void Project::Load(const std::vector<std::string>& extra_flags,
const std::string& compilationDatabaseDirectory, const std::string& opt_compilation_db_dir,
const std::string& rootDirectory, const std::string& root_directory,
const std::string& resource_directory) { const std::string& resource_directory) {
// Load data. // Load data.
ProjectConfig config; ProjectConfig config;
config.extra_flags = extra_flags; config.extra_flags = extra_flags;
config.project_dir = rootDirectory; config.project_dir = root_directory;
config.resource_dir = resource_directory; config.resource_dir = resource_directory;
entries = LoadCompilationEntriesFromDirectory(&config, entries = LoadCompilationEntriesFromDirectory(&config,
compilationDatabaseDirectory); opt_compilation_db_dir);
// Cleanup / postprocess include directories. // Cleanup / postprocess include directories.
quote_include_directories.assign(config.quote_dirs.begin(), quote_include_directories.assign(config.quote_dirs.begin(),

View File

@ -31,15 +31,15 @@ struct Project {
// Loads a project for the given |directory|. // 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 // 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, // instead. Otherwise, a recursive directory listing of all *.cpp, *.cc, *.h,
// and *.hpp files will be used. clang arguments can be specified in a // 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<std::string>& extra_flags, void Load(const std::vector<std::string>& extra_flags,
const std::string& compilationDatabaseDirectory, const std::string& opt_compilation_db_dir,
const std::string& rootDirectory, const std::string& root_directory,
const std::string& resource_directory); const std::string& resource_directory);
// Lookup the CompilationEntry for |filename|. If no entry was found this // Lookup the CompilationEntry for |filename|. If no entry was found this