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:
Nikolai Kosjar
2019-07-23 08:28:13 +02:00
parent 82bcf4e9f5
commit e6d16b6747
29 changed files with 877 additions and 3 deletions

View File

@@ -33,6 +33,15 @@ bool ExplainingStep::isValid() const
return location.isValid() && !ranges.isEmpty() && !message.isEmpty();
}
bool operator==(const ExplainingStep &lhs, const ExplainingStep &rhs)
{
return lhs.message == rhs.message
&& lhs.location == rhs.location
&& lhs.ranges == rhs.ranges
&& lhs.isFixIt == rhs.isFixIt
;
}
bool Diagnostic::isValid() const
{
return !description.isEmpty();
@@ -46,5 +55,16 @@ quint32 qHash(const Diagnostic &diagnostic)
^ diagnostic.location.column;
}
bool operator==(const Diagnostic &lhs, const Diagnostic &rhs)
{
return lhs.description == rhs.description
&& lhs.category == rhs.category
&& lhs.type == rhs.type
&& lhs.location == rhs.location
&& lhs.explainingSteps == rhs.explainingSteps
&& lhs.hasFixits == rhs.hasFixits
;
}
} // namespace Internal
} // namespace ClangTools