From b30d1749d627eb7fcc75f6011479f70bea00428d Mon Sep 17 00:00:00 2001 From: Christian Stenger Date: Tue, 16 Apr 2024 14:10:16 +0200 Subject: [PATCH] QmlJS: Add small tweak to semantic highlighter Check for enum key name starting upper case to avoid processing code that may match other cases as well. Task-number: QTCREATORBUG-19226 Change-Id: I07b62b492e2b220b7fbb3eb3fc2fb3136b554254 Reviewed-by: Ulf Hermann --- src/plugins/qmljseditor/qmljssemantichighlighter.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/plugins/qmljseditor/qmljssemantichighlighter.cpp b/src/plugins/qmljseditor/qmljssemantichighlighter.cpp index 1d725360c55..31574997138 100644 --- a/src/plugins/qmljseditor/qmljssemantichighlighter.cpp +++ b/src/plugins/qmljseditor/qmljssemantichighlighter.cpp @@ -370,6 +370,8 @@ protected: bool visit(FieldMemberExpression *ast) override { + if (ast->name.isEmpty() || ast->name.first().isLower()) + return true; // we only support IdentifierExpression.FieldMemberExpression (enum) const FieldMemberExpression *right = ast; if (const IdentifierExpression *idExp = cast(ast->base)) {