QmlJS: Fix issues with getting modulePaths

This patch

- improves performance by removing the usage of QRegularExpression for
trivial string operations (this is called 3000 times after configuring
Qt Creator)

- fixes handling of version number like "2.-1" which are the result of
imports with only a major version number like "import QtQuick 2"

Task-number: QTCREATORBUG-25899
Fixes: QTCREATORBUG-26178
Fixes: QTCREATORBUG-26216
Change-Id: Ic792909513f4fe25ac72043645f297ee41890375
Reviewed-by: Fawzi Mohamed <fawzi.mohamed@qt.io>
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
This commit is contained in:
Eike Ziller
2021-06-23 10:27:08 +02:00
parent 481070d808
commit 95de5c93b1
5 changed files with 100 additions and 13 deletions

View File

@@ -57,6 +57,7 @@ QMLJS_EXPORT DiagnosticMessage errorMessage(const SourceLocation &loc,
QMLJS_EXPORT bool maybeModuleVersion(const QString &version);
QMLJS_EXPORT const QStringList splitVersion(const QString &version);
QMLJS_EXPORT QStringList modulePaths(const QString &moduleImportName, const QString &version,
const QStringList &importPaths);