Commit 5f196cf5 authored by Christian Kamm's avatar Christian Kamm
Browse files

QmlJS: Make follow symbol work with member properties.

A full evaluate() call resolves the property and continues to the
underlying type. If we use Evaluate::reference() instead, we only the
first step is done and we can get at the source location if a
ASTPropertyReference is returned.

Reviewed-by: Erik Verbruggen
parent 7dfb2bd5
......@@ -40,6 +40,7 @@
#include "qmljsautocompleter.h"
#include <qmljs/qmljsbind.h>
#include <qmljs/qmljsevaluate.h>
#include <qmljs/qmljsdocument.h>
#include <qmljs/qmljsicontextpane.h>
#include <qmljs/qmljslookupcontext.h>
......@@ -1310,7 +1311,8 @@ TextEditor::BaseTextEditor::Link QmlJSTextEditor::findLinkAt(const QTextCursor &
LookupContext::Ptr lookupContext = semanticInfo.lookupContext(semanticInfo.astPath(cursorPosition));
const Interpreter::Value *value = lookupContext->evaluate(node);
Evaluate evaluator(lookupContext->context());
const Interpreter::Value *value = evaluator.reference(node);
QString fileName;
int line = 0, column = 0;
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment