forked from qt-creator/qt-creator
ClangCodeModel: Support "parentheses" matching for ternary operator
That is, show which ":" belongs to which "?" when the cursor is on one of them. Fixes: QTCREATORBUG-1410 Change-Id: Ie19360b3dfc82d92c264d99a5aa1864eda66e5c8 Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
@@ -115,6 +115,8 @@ bool ignore(ClangBackEnd::HighlightingType type)
|
||||
case HighlightingType::TemplateTemplateParameter:
|
||||
case HighlightingType::AngleBracketOpen:
|
||||
case HighlightingType::AngleBracketClose:
|
||||
case HighlightingType::TernaryIf:
|
||||
case HighlightingType::TernaryElse:
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -147,6 +149,10 @@ 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::TernaryIf))
|
||||
result.kind = CppTools::SemanticHighlighter::TernaryIf;
|
||||
else if (tokenInfo.types.mixinHighlightingTypes.contains(HighlightingType::TernaryElse))
|
||||
result.kind = CppTools::SemanticHighlighter::TernaryElse;
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user