forked from qt-creator/qt-creator
QmlJS: Do not set import as invalid if sub import fails
QtQuick.Controls has sub imports like QtQuick.Controls.macOS/windows that wil lbe invalid on other platforms. In this case we do not want to mark the original import as invalid, since it turns off checks in QmlJSCheck. Therefore moving the setting to invalid into the block that is only executed for non optional sub imports. Task-number: QDS-9094 Change-Id: If0ad4e32c14d608f88b8239f390208e51a93fbd8 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
This commit is contained in:
@@ -521,8 +521,8 @@ bool LinkPrivate::importLibrary(const Document::Ptr &doc,
|
||||
bool subImportFound = importLibrary(doc, subImport.libraryPath, &subImport, targetObject, importPath, true);
|
||||
|
||||
if (!subImportFound && errorLoc.isValid()) {
|
||||
import->valid = false;
|
||||
if (!(optional || (toImport.flags & QmlDirParser::Import::Optional))) {
|
||||
import->valid = false;
|
||||
error(doc,
|
||||
errorLoc,
|
||||
Link::tr("Implicit import '%1' of QML module '%2' not found.\n\n"
|
||||
|
||||
Reference in New Issue
Block a user