forked from qt-creator/qt-creator
qmljs: relax checks for qbs files
Types information for qbs is more limited that qml; this causes qtcreator to raise false positives. This patch relax the checks and provide some type information needed by qbs files generated by the wizards. Task-number: QTCREATORBUG-19757 Change-Id: I07a1dd9d8fedaf4c5c751c2f00643f15ae39127a Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
@@ -392,6 +392,15 @@ Import LinkPrivate::importNonFile(Document::Ptr doc, const ImportInfo &importInf
|
||||
import.object->setPrototype(valueOwner->cppQmlTypes().objectByCppName(moduleApi.cppName));
|
||||
}
|
||||
|
||||
// TODO: at the moment there is not any types information on Qbs imports.
|
||||
// Just check that tha the import is listed in the Qbs bundle.
|
||||
if (doc->language() == Dialect::QmlQbs) {
|
||||
QmlBundle qbs = ModelManagerInterface::instance()
|
||||
->activeBundles().bundleForLanguage(Dialect::QmlQbs);
|
||||
if (qbs.supportedImports().contains(importInfo.name()))
|
||||
importFound = true;
|
||||
}
|
||||
|
||||
if (!importFound && importInfo.ast()) {
|
||||
import.valid = false;
|
||||
error(doc, locationFromRange(importInfo.ast()->firstSourceLocation(),
|
||||
|
||||
Reference in New Issue
Block a user