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:
Marco Benelli
2018-02-27 13:13:51 +01:00
parent 0474216e2f
commit 2acb365dac
3 changed files with 167 additions and 0 deletions

View File

@@ -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(),