From 5f196cf5b8202d95eea4a93d45e4ce5fee7d6ed1 Mon Sep 17 00:00:00 2001
From: Christian Kamm <christian.d.kamm@nokia.com>
Date: Tue, 16 Nov 2010 14:39:54 +0100
Subject: [PATCH] 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
---
 src/plugins/qmljseditor/qmljseditor.cpp | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/plugins/qmljseditor/qmljseditor.cpp b/src/plugins/qmljseditor/qmljseditor.cpp
index 1a8490dc673..d7e3d2add5e 100644
--- a/src/plugins/qmljseditor/qmljseditor.cpp
+++ b/src/plugins/qmljseditor/qmljseditor.cpp
@@ -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;
-- 
GitLab