forked from qt-creator/qt-creator
ClangTools: Support loading exported diagnostics
Add a new toolbar button to load diagnostics exported with $ clang-tidy -export-fixes=/path/to/file $ clazy-standalone -export-fixes=/path/to/file (master version) Change-Id: I8316fe0706a18222e68220ef4fbfdc7ae8d09804 Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
@@ -64,6 +64,12 @@
|
||||
#include <tooltipinfo.h>
|
||||
#include <usedmacro.h>
|
||||
#include <utils/link.h>
|
||||
#include <cpptools/usages.h>
|
||||
#include <projectexplorer/projectmacro.h>
|
||||
#include <projectexplorer/headerpath.h>
|
||||
#include <coreplugin/find/searchresultitem.h>
|
||||
#include <coreplugin/locator/ilocatorfilter.h>
|
||||
#include <clangtools/clangtoolsdiagnostic.h>
|
||||
|
||||
namespace {
|
||||
ClangBackEnd::FilePathCaching *filePathCache = nullptr;
|
||||
@@ -1303,6 +1309,38 @@ std::ostream &operator<<(std::ostream &out, const Usage &usage)
|
||||
}
|
||||
} // namespace CppTools
|
||||
|
||||
namespace Debugger {
|
||||
std::ostream &operator<<(std::ostream &out, const DiagnosticLocation &loc)
|
||||
{
|
||||
return out << "(" << loc.filePath << ", " << loc.line << ", " << loc.column << ")";
|
||||
}
|
||||
} // namespace Debugger
|
||||
|
||||
namespace ClangTools {
|
||||
namespace Internal {
|
||||
std::ostream &operator<<(std::ostream &out, const ExplainingStep &step)
|
||||
{
|
||||
return out << "("
|
||||
<< step.message << ", "
|
||||
<< step.location << ", "
|
||||
<< step.ranges << ", "
|
||||
<< step.isFixIt
|
||||
<< ")";
|
||||
}
|
||||
|
||||
std::ostream &operator<<(std::ostream &out, const Diagnostic &diag) {
|
||||
return out << "("
|
||||
<< diag.description << ", "
|
||||
<< diag.category << ", "
|
||||
<< diag.type << ", "
|
||||
<< diag.location << ", "
|
||||
<< diag.explainingSteps << ", "
|
||||
<< diag.hasFixits
|
||||
<< ")";
|
||||
}
|
||||
} // namespace Internal
|
||||
} // namespace ClangTools
|
||||
|
||||
void setFilePathCache(ClangBackEnd::FilePathCaching *cache)
|
||||
{
|
||||
filePathCache = cache;
|
||||
|
||||
Reference in New Issue
Block a user