QmlJS: Add warning if we use a Qt Quick 1 code model for Qt Quick 2

In some cases we use a Qt Quick 1 code model for a file with Qt Quick 2
imports. This patch adds a warning for this, since
auto completion is incomplete.

Change-Id: I60888fd269c02f38da097104f5ecc982dd65573a
Reviewed-by: Fawzi Mohamed <fawzi.mohamed@digia.com>
This commit is contained in:
Thomas Hartmann
2013-11-13 17:20:01 +01:00
parent efe2f64efe
commit f4aa51565b
4 changed files with 34 additions and 3 deletions

View File

@@ -41,6 +41,8 @@
namespace QmlJS {
class Imports;
class QMLJS_EXPORT Check: protected AST::Visitor
{
Q_DECLARE_TR_FUNCTIONS(QmlJS::Check)
@@ -115,6 +117,8 @@ private:
void scanCommentsForAnnotations();
void warnAboutUnnecessarySuppressions();
bool isQtQuick2() const;
AST::Node *parent(int distance = 0);
Document::Ptr _doc;
@@ -143,6 +147,8 @@ private:
bool _importsOk;
bool _inStatementBinding;
const Imports *_imports;
bool _isQtQuick2;
};
} // namespace QmlJS