ClangCodeModel: Ignore redundant semantic tokens

This can now happen due to the newly implemented refresh support.

Change-Id: If64feede84b044140f7ec04e317289d3f493aa53
Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
Christian Kandeler
2021-11-03 15:30:57 +01:00
parent 98e5639f78
commit 4022043792
2 changed files with 19 additions and 0 deletions

View File

@@ -50,6 +50,11 @@ public:
QString type;
QStringList modifiers;
};
inline bool operator==(const ExpandedSemanticToken &t1, const ExpandedSemanticToken &t2)
{
return t1.line == t2.line && t1.column == t2.column && t1.length == t2.length
&& t1.type == t2.type && t1.modifiers == t2.modifiers;
}
using SemanticTokensHandler = std::function<void(TextEditor::TextDocument *,
const QList<ExpandedSemanticToken> &, int)>;