diff options
author | Fawzi Mohamed <[email protected]> | 2014-06-02 14:35:57 +0200 |
---|---|---|
committer | Fawzi Mohamed <[email protected]> | 2014-06-23 11:37:11 +0200 |
commit | 4ae01e973ad180509c301ff302807215303154a3 (patch) | |
tree | 86b7bcc52e040e5d7edbc178e3f30b935fe1a70e /src/libs/qmljs/qmljsdescribevalue.cpp | |
parent | e61119feb9a88f9bd5d6a2e3debdd09ad85d1cb5 (diff) |
qmljs/qmljsdescribevalue: try to use context to resolve prototypes
Change-Id: I0e8529dc339e995be1817b2f3d18ca9bc2c80738
Reviewed-by: Thomas Hartmann <[email protected]>
Diffstat (limited to 'src/libs/qmljs/qmljsdescribevalue.cpp')
-rw-r--r-- | src/libs/qmljs/qmljsdescribevalue.cpp | 23 |
1 files changed, 17 insertions, 6 deletions
diff --git a/src/libs/qmljs/qmljsdescribevalue.cpp b/src/libs/qmljs/qmljsdescribevalue.cpp index ff35e1719fd..c0c8f2785f1 100644 --- a/src/libs/qmljs/qmljsdescribevalue.cpp +++ b/src/libs/qmljs/qmljsdescribevalue.cpp @@ -30,20 +30,23 @@ #include "qmljsdescribevalue.h" #include "qmljsinterpreter.h" +#include "qmljscontext.h" #include "parser/qmljsast_p.h" #include <QString> namespace QmlJS { -QString DescribeValueVisitor::describe(const Value *value, int depth) +QString DescribeValueVisitor::describe(const Value *value, int depth, ContextPtr context) { - DescribeValueVisitor describer(-depth); + DescribeValueVisitor describer(-depth, 0, 2, context); return describer(value); } -DescribeValueVisitor::DescribeValueVisitor(int detailDepth, int startIndent, int indentIncrement) - : m_depth(-detailDepth), m_indent(startIndent), m_indentIncrement(indentIncrement) +DescribeValueVisitor::DescribeValueVisitor(int startDepth, int startIndent, int indentIncrement, + ContextPtr context) + : m_depth(startDepth), m_indent(startIndent), m_indentIncrement(indentIncrement), + m_context(context) { } DescribeValueVisitor::~DescribeValueVisitor() @@ -381,8 +384,16 @@ void DescribeValueVisitor::visit(const Reference *value) } if (printDetail) { ValueOwner *vOwner = value->valueOwner(); - dump(QLatin1String("\n valueOwner@")); - dump(QString::fromLatin1("@%1").arg((quintptr)(void *)vOwner, 0, 16)); + dumpNewline(); + dump(QString::fromLatin1("valueOwner@%1").arg((quintptr)(void *)vOwner, 0, 16)); + if (!m_context.isNull()) { + dumpNewline(); + dump("referencedObject:"); + const Value *refObj = m_context->lookupReference(value); + openContext(); + (*this)(refObj); + closeContext(); + } closeContext(); } --m_depth; |