forked from qt-creator/qt-creator
Highlighting: Add highlighting style for punctuation
Currently only operators have their own style but not punctuation tokens. Make possible to highlight both. Task-number: QTCREATORBUG-20666 Change-Id: I9533e0f1bef65b86c4e4f5c9756571103584124b Reviewed-by: Marco Bubke <marco.bubke@qt.io>
This commit is contained in:
@@ -529,13 +529,13 @@ void TokenInfo::overloadedOperatorKind()
|
||||
if (inOperatorDeclaration && !isTokenPartOfOperator(declarationCursor, m_cxToken))
|
||||
return;
|
||||
|
||||
if (m_types.mainHighlightingType == HighlightingType::Invalid)
|
||||
m_types.mainHighlightingType = HighlightingType::Operator;
|
||||
m_types.mixinHighlightingTypes.push_back(HighlightingType::Operator);
|
||||
m_types.mixinHighlightingTypes.push_back(HighlightingType::OverloadedOperator);
|
||||
}
|
||||
|
||||
void TokenInfo::punctuationOrOperatorKind()
|
||||
{
|
||||
m_types.mainHighlightingType = HighlightingType::Punctuation;
|
||||
auto kind = m_originalCursor.kind();
|
||||
switch (kind) {
|
||||
case CXCursor_CallExpr:
|
||||
@@ -557,9 +557,7 @@ void TokenInfo::punctuationOrOperatorKind()
|
||||
case CXCursor_BinaryOperator:
|
||||
case CXCursor_CompoundAssignOperator:
|
||||
case CXCursor_ConditionalOperator:
|
||||
m_types.mainHighlightingType = HighlightingType::Operator;
|
||||
break;
|
||||
default:
|
||||
m_types.mixinHighlightingTypes.push_back(HighlightingType::Operator);
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user