forked from qt-creator/qt-creator
Add support for lazy prototypes.
Done-with: ckamm
This commit is contained in:
@@ -219,7 +219,7 @@ private:
|
||||
return;
|
||||
|
||||
_processed.insert(object);
|
||||
enumerateProperties(object->prototype());
|
||||
enumerateProperties(object->prototype(_context));
|
||||
|
||||
object->processMembers(this);
|
||||
}
|
||||
|
||||
@@ -179,7 +179,7 @@ void QmlHoverHandler::updateHelpIdAndTooltip(TextEditor::ITextEditor *editor, in
|
||||
const Interpreter::Value *value = check(node);
|
||||
|
||||
QStringList baseClasses;
|
||||
m_toolTip = prettyPrint(value, &interp, &baseClasses);
|
||||
m_toolTip = prettyPrint(value, link.context(), &baseClasses);
|
||||
|
||||
foreach (const QString &baseClass, baseClasses) {
|
||||
QString helpId = QLatin1String("QML.");
|
||||
@@ -210,10 +210,10 @@ void QmlHoverHandler::updateHelpIdAndTooltip(TextEditor::ITextEditor *editor, in
|
||||
}
|
||||
}
|
||||
|
||||
QString QmlHoverHandler::prettyPrint(const QmlJS::Interpreter::Value *value, QmlJS::Interpreter::Engine *interp,
|
||||
QString QmlHoverHandler::prettyPrint(const QmlJS::Interpreter::Value *value, QmlJS::Interpreter::Context *context,
|
||||
QStringList *baseClasses) const
|
||||
{
|
||||
if (!value)
|
||||
if (! value)
|
||||
return QString();
|
||||
|
||||
if (const Interpreter::ObjectValue *objectValue = value->asObjectValue()) {
|
||||
@@ -223,14 +223,14 @@ QString QmlHoverHandler::prettyPrint(const QmlJS::Interpreter::Value *value, Qml
|
||||
if (! className.isEmpty())
|
||||
baseClasses->append(className);
|
||||
|
||||
objectValue = objectValue->prototype();
|
||||
objectValue = objectValue->prototype(context);
|
||||
} while (objectValue);
|
||||
|
||||
if (! baseClasses->isEmpty())
|
||||
return baseClasses->first();
|
||||
}
|
||||
|
||||
QString typeId = interp->typeId(value);
|
||||
QString typeId = context->engine()->typeId(value);
|
||||
|
||||
if (typeId == QLatin1String("undefined"))
|
||||
typeId.clear();
|
||||
|
||||
@@ -47,6 +47,7 @@ class IEditor;
|
||||
namespace QmlJS {
|
||||
namespace Interpreter {
|
||||
class Engine;
|
||||
class Context;
|
||||
class Value;
|
||||
}
|
||||
}
|
||||
@@ -74,7 +75,7 @@ private slots:
|
||||
|
||||
private:
|
||||
void updateHelpIdAndTooltip(TextEditor::ITextEditor *editor, int pos);
|
||||
QString prettyPrint(const QmlJS::Interpreter::Value *value, QmlJS::Interpreter::Engine *interp,
|
||||
QString prettyPrint(const QmlJS::Interpreter::Value *value, QmlJS::Interpreter::Context *context,
|
||||
QStringList *baseClasses) const;
|
||||
|
||||
private:
|
||||
|
||||
Reference in New Issue
Block a user