forked from qt-creator/qt-creator
Improve Qml code model import handling.
* Fill the snapshot with files that could be imported. * Implement package imports. * The qmldir file is not parsed yet. Reviewed-by: Erik Verbruggen
This commit is contained in:
@@ -289,7 +289,8 @@ public:
|
||||
Context(Engine *engine);
|
||||
~Context();
|
||||
|
||||
void build(const QList<AST::Node *> &astPath, const Document::Ptr doc, const Snapshot &snapshot);
|
||||
void build(const QList<AST::Node *> &astPath, const Document::Ptr doc,
|
||||
const Snapshot &snapshot, const QStringList &importPaths);
|
||||
|
||||
Engine *engine() const;
|
||||
const ScopeChain &scopeChain() const;
|
||||
@@ -313,7 +314,7 @@ private:
|
||||
Engine *_engine;
|
||||
LookupMode _lookupMode;
|
||||
QHash<const ObjectValue *, Properties> _properties;
|
||||
QHash<const Document *, const ObjectValue *> _typeEnvironments;
|
||||
QHash<QString, const ObjectValue *> _typeEnvironments;
|
||||
ScopeChain _scopeChain;
|
||||
int _qmlScopeObjectIndex;
|
||||
bool _qmlScopeObjectSet;
|
||||
@@ -526,6 +527,8 @@ public:
|
||||
QList<Interpreter::QmlObjectValue *> staticTypesForImport(const QString &prefix, int majorVersion, int minorVersion) const;
|
||||
Interpreter::QmlObjectValue *staticTypeForImport(const QString &qualifiedName) const;
|
||||
|
||||
bool hasPackage(const QString &package) const;
|
||||
|
||||
private:
|
||||
QHash<QString, QList<QmlObjectValue *> > _importedTypes;
|
||||
};
|
||||
|
Reference in New Issue
Block a user