forked from qt-creator/qt-creator
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:
@@ -599,6 +599,17 @@ protected:
|
||||
return true;
|
||||
}
|
||||
|
||||
bool visit(UiEnumDeclaration *node) override
|
||||
{
|
||||
if (containsOffset(node->identifierToken)) {
|
||||
_name = node->name.toString();
|
||||
_scope = _doc->bind()->findQmlObject(_objectNode);
|
||||
_targetValue = _scopeChain->context()->lookupType(_doc.data(), QStringList(_name));
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
bool visit(FunctionDeclaration *node) override
|
||||
{
|
||||
return visit(static_cast<FunctionExpression *>(node));
|
||||
|
||||
Reference in New Issue
Block a user