mirror of
https://github.com/MaskRay/ccls.git
synced 2024-11-22 15:45:08 +00:00
Try parsing with full argv. Also hide system diagnostics.
This commit is contained in:
parent
c77531a432
commit
839f3d9968
5
foo/.vscode/settings.json
vendored
5
foo/.vscode/settings.json
vendored
@ -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/.*"
|
||||
]
|
||||
}
|
15
foo/b.cc
15
foo/b.cc
@ -3,9 +3,16 @@
|
||||
|
||||
|
||||
|
||||
struct Baz {
|
||||
struct Baz3 {
|
||||
};
|
||||
|
||||
void foo() {
|
||||
Baz b;
|
||||
}
|
||||
|
||||
struct Foobar {
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -227,6 +227,7 @@ void diagnostic(CXClientData client_data,
|
||||
CXFile file;
|
||||
unsigned int line, column;
|
||||
CXSourceLocation location = clang_getDiagnosticLocation(diagnostic);
|
||||
if (!clang_Location_isInSystemHeader(location)) {
|
||||
clang_getSpellingLocation(location, &file, &line, &column, nullptr);
|
||||
|
||||
// Fetch path, print.
|
||||
@ -235,6 +236,7 @@ void diagnostic(CXClientData client_data,
|
||||
std::cerr << NormalizePath(path) << ':';
|
||||
}
|
||||
std::cerr << line << ':' << column << ": " << spelling << std::endl;
|
||||
}
|
||||
|
||||
clang_disposeDiagnostic(diagnostic);
|
||||
}
|
||||
|
@ -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);
|
||||
|
||||
|
@ -205,6 +205,7 @@ std::vector<Project::Entry> 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) {
|
||||
|
Loading…
Reference in New Issue
Block a user