forked from qt-creator/qt-creator
ClangCodeModel: Fix template highlighting bug
We need to take into account that the ">>" in constructs such as std::vector<std::pair<int, int>> is only one token on the clang side. Change-Id: I90f002ca56f236032f6d39c338593a2ff7590061 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
@@ -115,6 +115,7 @@ bool ignore(ClangBackEnd::HighlightingType type)
|
||||
case HighlightingType::TemplateTemplateParameter:
|
||||
case HighlightingType::AngleBracketOpen:
|
||||
case HighlightingType::AngleBracketClose:
|
||||
case HighlightingType::DoubleAngleBracketClose:
|
||||
case HighlightingType::TernaryIf:
|
||||
case HighlightingType::TernaryElse:
|
||||
return true;
|
||||
@@ -149,6 +150,8 @@ TextEditor::HighlightingResult toHighlightingResult(
|
||||
result.kind = CppTools::SemanticHighlighter::AngleBracketOpen;
|
||||
else if (tokenInfo.types.mixinHighlightingTypes.contains(HighlightingType::AngleBracketClose))
|
||||
result.kind = CppTools::SemanticHighlighter::AngleBracketClose;
|
||||
else if (tokenInfo.types.mixinHighlightingTypes.contains(HighlightingType::DoubleAngleBracketClose))
|
||||
result.kind = CppTools::SemanticHighlighter::DoubleAngleBracketClose;
|
||||
else if (tokenInfo.types.mixinHighlightingTypes.contains(HighlightingType::TernaryIf))
|
||||
result.kind = CppTools::SemanticHighlighter::TernaryIf;
|
||||
else if (tokenInfo.types.mixinHighlightingTypes.contains(HighlightingType::TernaryElse))
|
||||
|
||||
Reference in New Issue
Block a user