forked from qt-creator/qt-creator
Qmljs: find usages for types and packages
detects and finds usages of types and packages in qml and javascript Change-Id: Id13f48e435258ff10ab3e6f49049f7bb602a900f Reviewed-on: http://codereview.qt.nokia.com/277 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Christian Kamm <christian.d.kamm@nokia.com>
This commit is contained in:
@@ -1014,7 +1014,8 @@ const Value *Context::lookup(const QString &name, const ObjectValue **foundInSco
|
||||
return _engine->undefinedValue();
|
||||
}
|
||||
|
||||
const ObjectValue *Context::lookupType(const QmlJS::Document *doc, UiQualifiedId *qmlTypeName) const
|
||||
const ObjectValue *Context::lookupType(const QmlJS::Document *doc, UiQualifiedId *qmlTypeName,
|
||||
UiQualifiedId *qmlTypeNameEnd) const
|
||||
{
|
||||
const Imports *importsObj = imports(doc);
|
||||
if (!importsObj)
|
||||
@@ -1023,7 +1024,8 @@ const ObjectValue *Context::lookupType(const QmlJS::Document *doc, UiQualifiedId
|
||||
if (!objectValue)
|
||||
return 0;
|
||||
|
||||
for (UiQualifiedId *iter = qmlTypeName; objectValue && iter; iter = iter->next) {
|
||||
for (UiQualifiedId *iter = qmlTypeName; objectValue && iter && iter != qmlTypeNameEnd;
|
||||
iter = iter->next) {
|
||||
if (! iter->name)
|
||||
return 0;
|
||||
|
||||
|
@@ -332,7 +332,8 @@ public:
|
||||
void setImports(const Document *doc, const Imports *imports);
|
||||
|
||||
const Value *lookup(const QString &name, const ObjectValue **foundInScope = 0) const;
|
||||
const ObjectValue *lookupType(const Document *doc, AST::UiQualifiedId *qmlTypeName) const;
|
||||
const ObjectValue *lookupType(const Document *doc, AST::UiQualifiedId *qmlTypeName,
|
||||
AST::UiQualifiedId *qmlTypeNameEnd = 0) const;
|
||||
const ObjectValue *lookupType(const Document *doc, const QStringList &qmlTypeName) const;
|
||||
const Value *lookupReference(const Value *value) const;
|
||||
|
||||
|
Reference in New Issue
Block a user