forked from qt-creator/qt-creator
Merge remote-tracking branch 'origin/7.0'
Change-Id: I01ce83a2da66bb65af37c0ecc92372789cb85c01
This commit is contained in:
@@ -3967,10 +3967,18 @@ void ExtraHighlightingResultsCollector::collectFromNode(const AstNode &node)
|
||||
QString detail = node.detail().value_or(QString());
|
||||
const bool isCallToNew = node.kind() == "CXXNew";
|
||||
const bool isCallToDelete = node.kind() == "CXXDelete";
|
||||
if (!isCallToNew && !isCallToDelete
|
||||
&& (!detail.startsWith(operatorPrefix) || detail == operatorPrefix)) {
|
||||
const auto isProperOperator = [&] {
|
||||
if (isCallToNew || isCallToDelete)
|
||||
return true;
|
||||
if (!detail.startsWith(operatorPrefix))
|
||||
return false;
|
||||
if (detail == operatorPrefix)
|
||||
return false;
|
||||
const QChar nextChar = detail.at(operatorPrefix.length());
|
||||
return !nextChar.isLetterOrNumber() && nextChar != '_';
|
||||
};
|
||||
if (!isProperOperator())
|
||||
return;
|
||||
}
|
||||
|
||||
if (!isCallToNew && !isCallToDelete)
|
||||
detail.remove(0, operatorPrefix.length());
|
||||
|
||||
Reference in New Issue
Block a user