qmljs: adding qrc support

Qmljs now keeps a cache of parsed qrc files, and can resolve "qrc:" links.

This breaks the assumption that the name that the qml files has on
the filesystem is the one that qml sees, and that contents of
directories can be found just looking at file whose path starts with the
directory path.

Currently the first file is used when multiple qrc files contain the same
path, but support for strict and weak path resolving is already there.

At the moment only qrc files for projects that call updateQmljsCodeModel
are updated.

ChangeLog: QmljsSupport: Imports using qrc links are resolved.

Task-number: QTCREATORBUG-8953
Change-Id: I695fac2692af2417d49c192c580a1c2e7b4873f4
Reviewed-by: Fawzi Mohamed <fawzi.mohamed@digia.com>
This commit is contained in:
Fawzi Mohamed
2013-05-21 11:35:15 +02:00
parent 69a9dc3f1c
commit 5a4cdc11cb
23 changed files with 1109 additions and 19 deletions

View File

@@ -115,6 +115,22 @@ bool Document::isFullySupportedLanguage(Document::Language language)
return false;
}
bool Document::isQmlLikeOrJsLanguage(Document::Language language)
{
switch (language) {
case QmlLanguage:
case QmlQtQuick1Language:
case QmlQtQuick2Language:
case QmlQbsLanguage:
case QmlProjectLanguage:
case QmlTypeInfoLanguage:
case JavaScriptLanguage:
return true;
default:
return false;
}
}
Document::Document(const QString &fileName, Language language)
: _engine(0)
, _ast(0)