QmlJS: Improve support for multiple imports into same alias

Add extra handling for aliased imports to avoid handling
shadowed imports as unknown which in turn ignored them
and marked their members as unknown types and did not
provide auto completion for their members.

Fixes: QTCREATORBUG-15684
Change-Id: Iee1009cbdfde13ce261854c3239b9b50c434f563
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
This commit is contained in:
Christian Stenger
2019-12-03 11:07:47 +01:00
parent e5f1559bb6
commit 8f682573a8
3 changed files with 74 additions and 36 deletions

View File

@@ -1094,10 +1094,13 @@ public:
bool importFailed() const;
const QList<Import> &all() const;
const ObjectValue *aliased(const QString &name) const;
const TypeScope *typeScope() const;
const JSImportScope *jsImportScope() const;
const ObjectValue *resolveAliasAndMarkUsed(const QString &name) const;
#ifdef QT_DEBUG
void dump() const;
#endif
@@ -1106,6 +1109,7 @@ private:
// holds imports in the order they appeared,
// lookup order is back to front
QList<Import> m_imports;
QHash<QString, ObjectValue *> m_aliased;
TypeScope *m_typeScope;
JSImportScope *m_jsImportScope;
bool m_importFailed;