forked from qt-creator/qt-creator
QmlJS: Remove the strict separation of types and attached types.
The problem was that several lookup calls suddenly failed because
the actual QML types were no longer in the default scope chain. However,
the QML documentation says the type names are in the scope.
Also, 'MyComponent.' in a JS-expression context only showed the attached
properties of MyComponent and missed the enums.
With this change completion now may offers too many options, but that's
better than missing some.
This reverts parts of 490f2797f6
Reviewed-by: Leandro Melo
This commit is contained in:
@@ -305,7 +305,6 @@ public:
|
||||
QSharedPointer<const QmlComponentChain> qmlComponentScope;
|
||||
QList<const ObjectValue *> qmlScopeObjects;
|
||||
const TypeEnvironment *qmlTypes;
|
||||
const AttachedTypeEnvironment *qmlAttachedTypes;
|
||||
QList<const ObjectValue *> jsScopes;
|
||||
|
||||
// rebuilds the flat list of all scopes
|
||||
@@ -1038,19 +1037,6 @@ public:
|
||||
ImportInfo importInfo(const QString &name, const Context *context) const;
|
||||
};
|
||||
|
||||
class QMLJS_EXPORT AttachedTypeEnvironment: public ObjectValue
|
||||
{
|
||||
const TypeEnvironment *_typeEnvironment;
|
||||
|
||||
public:
|
||||
AttachedTypeEnvironment(const TypeEnvironment *typeEnv);
|
||||
|
||||
virtual const Value *lookupMember(const QString &name, const Context *context,
|
||||
const ObjectValue **foundInObject = 0,
|
||||
bool examinePrototypes = true) const;
|
||||
virtual void processMembers(MemberProcessor *processor) const;
|
||||
};
|
||||
|
||||
} } // namespace QmlJS::Interpreter
|
||||
|
||||
#endif // QMLJS_INTERPRETER_H
|
||||
|
Reference in New Issue
Block a user