diff --git a/plugins/cpp/parser/src/cppparser.cpp b/plugins/cpp/parser/src/cppparser.cpp index c11687acc..3730cbdcc 100644 --- a/plugins/cpp/parser/src/cppparser.cpp +++ b/plugins/cpp/parser/src/cppparser.cpp @@ -750,6 +750,15 @@ bool CppParser::parseByJson( std::vector compileCommands = compDb->getAllCompileCommands(); + + compileCommands.erase( + std::remove_if(compileCommands.begin(), compileCommands.end(), + [&](const clang::tooling::CompileCommand& c) + { + return !isSourceFile(c.Filename); + }), + compileCommands.end()); + std::size_t numCompileCommands = compileCommands.size(); //--- Create a thread pool for the current commands ---//