QmlJS: Fix handling multiple import paths into same module

It is possible to import components of different paths to fill
a module.
Take further paths into account when looking up types.

Fixes: QTCREATORBUG-24405
Change-Id: I8d6bf0a324ea9c0d1fe9d91b40857f91f00dd662
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Reviewed-by: Fawzi Mohamed <fawzi.mohamed@qt.io>
This commit is contained in:
Christian Stenger
2021-01-11 14:09:51 +01:00
parent 7dc72c533e
commit 6ea088c02f
5 changed files with 30 additions and 18 deletions

View File

@@ -869,7 +869,9 @@ static QString modulePath(const ImportInfo &import, const QStringList &paths)
{
if (!import.version().isValid())
return QString();
return modulePath(import.name(), import.version().toString(), paths);
const QStringList modPaths = modulePaths(import.name(), import.version().toString(), paths);
return modPaths.value(0); // first is best match
}
static void findNewLibraryImports(const Document::Ptr &doc, const Snapshot &snapshot,