diff --git a/foo/.vscode/settings.json b/foo/.vscode/settings.json index 682d4784..d3f6269b 100644 --- a/foo/.vscode/settings.json +++ b/foo/.vscode/settings.json @@ -1,5 +1,8 @@ // Place your settings in this file to overwrite default and user settings. { "editor.lineNumbers": "on", - "cquery.cacheDirectory": "C:/Users/jacob/Desktop/superindex/indexer/foo/CACHE" + "cquery.cacheDirectory": "C:/Users/jacob/Desktop/superindex/indexer/foo/CACHE", + "cquery.blacklist": [ + ".*/CACHE/.*" + ] } \ No newline at end of file diff --git a/foo/a.h b/foo/a.h index 158aa345..8703093e 100644 --- a/foo/a.h +++ b/foo/a.h @@ -14,9 +14,5 @@ - - - - void foobar() {} \ No newline at end of file diff --git a/foo/b.cc b/foo/b.cc index 3f9ebc08..fa300449 100644 --- a/foo/b.cc +++ b/foo/b.cc @@ -3,9 +3,16 @@ -struct Baz { +struct Baz3 { }; -void foo() { - Baz b; -} \ No newline at end of file + +struct Foobar { + +}; + + + + + + diff --git a/src/indexer.cc b/src/indexer.cc index 283ac76a..4d942085 100644 --- a/src/indexer.cc +++ b/src/indexer.cc @@ -227,14 +227,16 @@ void diagnostic(CXClientData client_data, CXFile file; unsigned int line, column; CXSourceLocation location = clang_getDiagnosticLocation(diagnostic); - clang_getSpellingLocation(location, &file, &line, &column, nullptr); + if (!clang_Location_isInSystemHeader(location)) { + clang_getSpellingLocation(location, &file, &line, &column, nullptr); - // Fetch path, print. - if (file != nullptr) { - std::string path = clang::ToString(clang_getFileName(file)); - std::cerr << NormalizePath(path) << ':'; + // Fetch path, print. + if (file != nullptr) { + std::string path = clang::ToString(clang_getFileName(file)); + std::cerr << NormalizePath(path) << ':'; + } + std::cerr << line << ':' << column << ": " << spelling << std::endl; } - std::cerr << line << ':' << column << ": " << spelling << std::endl; clang_disposeDiagnostic(diagnostic); } diff --git a/src/libclangmm/TranslationUnit.cc b/src/libclangmm/TranslationUnit.cc index d6f1206b..336d0a98 100644 --- a/src/libclangmm/TranslationUnit.cc +++ b/src/libclangmm/TranslationUnit.cc @@ -32,7 +32,7 @@ TranslationUnit::TranslationUnit(IndexerConfig* config, std::cerr << arg << " "; std::cerr << std::endl; - CXErrorCode error_code = clang_parseTranslationUnit2( + CXErrorCode error_code = clang_parseTranslationUnit2FullArgv( index.cx_index, filepath.c_str(), args.data(), args.size(), unsaved_files.data(), unsaved_files.size(), flags, &cx_tu); diff --git a/src/project.cc b/src/project.cc index 4980fb22..790c8683 100644 --- a/src/project.cc +++ b/src/project.cc @@ -205,6 +205,7 @@ std::vector LoadCompilationEntriesFromDirectory(const std::strin // TODO: Figure out if this function or the clang one is faster. //return LoadFromCompileCommandsJson(project_directory); + std::cerr << "Trying to load compile_commands.json" << std::endl; CXCompilationDatabase_Error cx_db_load_error; CXCompilationDatabase cx_db = clang_CompilationDatabase_fromDirectory(project_directory.c_str(), &cx_db_load_error); if (cx_db_load_error == CXCompilationDatabase_CanNotLoadDatabase) {