Open
Description
Hi, when using bear (https://github.com/rizsotto/Bear) you get compile_commands.jsons without the command json object but with an "arguments" array. this patch will check if the command object is available and if not create it out of the arguments array:
CompileCommandsCompilationUnitsParser.cpp: (Line 116):
CompilationUnit cu;
if(cmdJson.find("command") == cmdJson.end()) {
//no command object available, create one from the arguments object
auto args = cmdJson["arguments"];
bool firstRun = true;
for(json::iterator it = args.begin(); it != args.end(); ++it) {
if(!firstRun) {
cu.compilationCommandStr += " ";
}
firstRun = false;
cu.compilationCommandStr += *it;
}
} else {
cu.compilationCommandStr = cmdJson["command"];
}
auto dirPath = TeenyPath::path(cmdJson["directory"].get<std::string>());
if (dirPath.exists()) {
dirPath = dirPath.resolve_absolute();
Metadata
Metadata
Assignees
Labels
No labels