forked from qt-creator/qt-creator
ClangCodeModel: Ignore boolean and pointer literals
... when doing semantic highlighting. The syntax highlighter already handles these. Change-Id: I048e033eda5b72d2e6eafaaccdb66040a00afe6a Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
@@ -597,11 +597,11 @@ void ExtraHighlightingResultsCollector::collectFromNode(const ClangdAstNode &nod
|
||||
if (node.kind() == "UserDefinedLiteral")
|
||||
return;
|
||||
if (node.kind().endsWith("Literal")) {
|
||||
const bool isKeyword = node.kind() == "CXXBoolLiteral"
|
||||
|| node.kind() == "CXXNullPtrLiteral";
|
||||
if (!isKeyword && (node.kind().startsWith("String") || node.kind().startsWith("Character")))
|
||||
if (node.kind() == "CXXBoolLiteral" || node.kind() == "CXXNullPtrLiteral")
|
||||
return;
|
||||
insertResult(node, isKeyword ? C_KEYWORD : C_NUMBER);
|
||||
if (node.kind().startsWith("String") || node.kind().startsWith("Character"))
|
||||
return;
|
||||
insertResult(node, C_NUMBER);
|
||||
return;
|
||||
}
|
||||
if (node.role() == "type" && node.kind() == "Builtin") {
|
||||
|
||||
Reference in New Issue
Block a user