diff options
author | Nikolai Kosjar <[email protected]> | 2019-07-23 08:28:13 +0200 |
---|---|---|
committer | Nikolai Kosjar <[email protected]> | 2019-09-03 09:39:48 +0000 |
commit | e6d16b67471d6d044c485847882ce4ac7dea365f (patch) | |
tree | 1dc46d80da89c29ffe56fc1c487acd1a034f04f6 /src/plugins/clangtools/clangtoolsdiagnostic.cpp | |
parent | 82bcf4e9f54337faf24a7372cfd622632f4988f8 (diff) |
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 <[email protected]>
Diffstat (limited to 'src/plugins/clangtools/clangtoolsdiagnostic.cpp')
-rw-r--r-- | src/plugins/clangtools/clangtoolsdiagnostic.cpp | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/plugins/clangtools/clangtoolsdiagnostic.cpp b/src/plugins/clangtools/clangtoolsdiagnostic.cpp index cb1f4ead62c..5e850659bf5 100644 --- a/src/plugins/clangtools/clangtoolsdiagnostic.cpp +++ b/src/plugins/clangtools/clangtoolsdiagnostic.cpp @@ -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 |