diff --git a/share/qtcreator/qml-type-descriptions/qbs-base.qmltypes b/share/qtcreator/qml-type-descriptions/qbs-base.qmltypes new file mode 100644 index 00000000000..e19fabc4d92 --- /dev/null +++ b/share/qtcreator/qml-type-descriptions/qbs-base.qmltypes @@ -0,0 +1,154 @@ +import QtQuick.tooling 1.0 + +Module { + Component { + name: "AndroidApk" + exports: ["qbs/AndroidApk 1.0"] + prototype: "Product" + Property { name: "packageName"; type: "string"} + Property { name: "automaticSources"; type: "bool"} + Property { name: "legacyLayout"; type: "bool"} + Property { name: "sourceSetDir"; type: "string"} + Property { name: "resourceDir"; type: "string"} + Property { name: "assetsDir"; type: "string"} + Property { name: "sourcesDir"; type: "string"} + Property { name: "manifestFile"; type: "string"} + Property { name: "defaultManifestFile"; type: "string"; isReadonly: true } + } + Component { + name: "AppleApplicationDiskImage" + exports: ["qbs/AppleApplicationDiskImage 1.0"] + prototype: "AppleDiskImage" + Property { name: "sourceBase"; type: "string" } + Property { name: "absoluteSourceBase"; type: "string"; isReadonly: true} + Property { name: "symlinks"; type: "string"; isList: true } + Property { name: "stageDirectory"; type: "string"; isReadonly: true} + + } + Component { + name: "AppleDiskImage" + exports: ["qbs/AppleDiskImage 1.0"] + prototype: "Product" + } + Component { + name: "ApplicationExtension" + exports: ["qbs/ApplicationExtension 1.0"] + prototype: "XPCService" + Property: { name: "_useLegacyExtensionLibraries"; type: "bool" } + Property: { name: "extensionAttributes"; type: "QVariant" } + Property: { name: "extensionPointIdentifier"; type: "string" } + Property: { name: "extensionPrincipalClass"; type: "string" } + } + Component { + name: "Application" + exports: ["qbs/Application 1.0"] + prototype: "NativeBinary" + } + Component { + name: "AutotestRunner" + exports: ["qbs/AutotestRunner 1.0"] + prototype: "Product" + } + Component { + name: "CppApplication" + exports: ["qbs/CppApplication 1.0"] + prototype: "Application" + } + Component { + name: "DynamicLibrary" + exports: ["qbs/DynamicLibrary 1.0"] + prototype: "Library" + } + Component { + name: "InnoSetup" + exports: ["qbs/InnoSetup 1.0"] + prototype: "Installer" + } + Component { + name: "Installer" + exports: ["qbs/Installer 1.0"] + prototype: "Product" + Property: { name: "dependsOnInstallables"; type: "bool" } + Property: { name: "auxiliaryInputs"; type: "string"; isList: true } + } + Component { + name: "InstallPackage" + exports: ["qbs/InstallPackage 1.0"] + prototype: "Product" + } + Component { + name: "JavaClassCollection" + exports: ["qbs/InstallPackage 1.0"] + prototype: "Product" + } + Component { + name: "JavaJarFile" + exports: ["qbs/JavaJarFile 1.0"] + prototype: "Product" + Property { name: "entryPoint"; type: "string" } + } + Component { + name: "Library" + exports: ["qbs/Library 1.0"] + prototype: "NativeBinary" + } + Component { + name: "LoadableModule" + exports: ["qbs/LoadableModule 1.0"] + prototype: "DynamicLibrary" + } + Component { + name: "NativeBinary" + exports: ["qbs/NativeBinary 1.0"] + prototype: "Product" + Property { name: "isForAndroid"; type: "bool" } + Property { name: "isForDarwin"; type: "bool" } + } + Component { + name: "NetModule" + exports: ["qbs/NetModule 1.0"] + prototype: "Product" + } + Component { + name: "NodeJSApplication" + exports: ["qbs/NodeJSApplication 1.0"] + prototype: "Product" + } + Component { + name: "NSISSetup" + exports: ["qbs/NSISSetup 1.0"] + prototype: "Installer" + } + Component { + name: "QtApplication" + exports: ["qbs/QtApplication 1.0"] + prototype: "CppApplication" + } + Component { + name: "QtGuiApplication" + exports: ["qbs/QtGuiApplication 1.0"] + prototype: "CppApplication" + Property { name: "linkDefaultQpaPlugin"; type: "bool" } + } + Component { + name: "StaticLibrary" + exports: ["qbs/StaticLibrary 1.0"] + prototype: "Library" + } + Component { + name: "WindowsInstallerPackage" + exports: ["qbs/WindowsInstallerPackage 1.0"] + prototype: "Installer" + } + Component { + name: "WindowsSetupPackage" + exports: ["qbs/WindowsSetupPackage 1.0"] + prototype: "Product" + } + Component { + name: "XPCService" + exports: ["qbs/XPCService 1.0"] + prototype: "Application" + Property { name: "xpcServiceType"; type: "string" } + } +} diff --git a/src/libs/qmljs/qmljscheck.cpp b/src/libs/qmljs/qmljscheck.cpp index 42558f65a4a..5b184d37b0b 100644 --- a/src/libs/qmljs/qmljscheck.cpp +++ b/src/libs/qmljs/qmljscheck.cpp @@ -855,6 +855,10 @@ static bool checkTopLevelBindingForParentReference(ExpressionStatement *expStmt, void Check::visitQmlObject(Node *ast, UiQualifiedId *typeId, UiObjectInitializer *initializer) { + // TODO: currently Qbs checks are not working properly + if (_doc->language() == Dialect::QmlQbs) + return; + // Don't do type checks if it's a grouped property binding. // For instance: anchors { ... } if (_doc->bind()->isGroupedPropertyBinding(ast)) { diff --git a/src/libs/qmljs/qmljslink.cpp b/src/libs/qmljs/qmljslink.cpp index 61cdcd15d22..9c7855c5fdb 100644 --- a/src/libs/qmljs/qmljslink.cpp +++ b/src/libs/qmljs/qmljslink.cpp @@ -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(),