QmlJS: Improve handling of user defined enums

Improves handling of Qml based enums inside qml documents.

 * completion of enums
 * follow the enum
 * highlighting values inside the declaration
 * displaying the enum declaration inside the outline
 * minor static checks

Task-number: QTCREATORBUG-19226
Change-Id: Ia07fd9a8b7fa3106f2ea53198bfdcc50eecb7307
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
This commit is contained in:
Christian Stenger
2024-04-08 15:30:05 +02:00
parent ee8245d8aa
commit e1d90a7965
13 changed files with 184 additions and 4 deletions

View File

@@ -348,6 +348,13 @@ protected:
return visit(static_cast<FunctionExpression *>(ast));
}
bool visit(UiEnumMemberList *ast) override
{
for (auto it = ast; it; it = it->next)
addUse(it->memberToken, SemanticHighlighter::FieldType);
return true;
}
bool visit(PatternElement *ast) override
{
if (ast->isVariableDeclaration())