Commit 68be307b authored by Christian Kamm's avatar Christian Kamm
Browse files

QmlJS: Use LookupContext in findLinkAt.

parent d292eca5
...@@ -35,14 +35,10 @@ ...@@ -35,14 +35,10 @@
#include "qmloutlinemodel.h" #include "qmloutlinemodel.h"
#include <qmljs/qmljsindenter.h> #include <qmljs/qmljsindenter.h>
#include <qmljs/qmljsinterpreter.h>
#include <qmljs/qmljsbind.h>
#include <qmljs/qmljscheck.h> #include <qmljs/qmljscheck.h>
#include <qmljs/qmljsevaluate.h>
#include <qmljs/qmljsdocument.h> #include <qmljs/qmljsdocument.h>
#include <qmljs/qmljslink.h>
#include <qmljs/qmljsscopebuilder.h>
#include <qmljs/qmljsicontextpane.h> #include <qmljs/qmljsicontextpane.h>
#include <qmljs/qmljslookupcontext.h>
#include <qmljs/parser/qmljsastvisitor_p.h> #include <qmljs/parser/qmljsastvisitor_p.h>
#include <qmljs/parser/qmljsast_p.h> #include <qmljs/parser/qmljsast_p.h>
#include <qmljs/parser/qmljsengine_p.h> #include <qmljs/parser/qmljsengine_p.h>
...@@ -1230,14 +1226,9 @@ TextEditor::BaseTextEditor::Link QmlJSTextEditor::findLinkAt(const QTextCursor & ...@@ -1230,14 +1226,9 @@ TextEditor::BaseTextEditor::Link QmlJSTextEditor::findLinkAt(const QTextCursor &
AST::Node *node = semanticInfo.nodeUnderCursor(cursorPosition); AST::Node *node = semanticInfo.nodeUnderCursor(cursorPosition);
Interpreter::Engine interp; LookupContext::Ptr lookupContext = LookupContext::create(semanticInfo.document, semanticInfo.snapshot, semanticInfo.astPath(cursorPosition));
Interpreter::Context context(&interp); const Interpreter::Value *value = lookupContext->evaluate(node);
QmlJS::Link linkedSnapshot(&context, semanticInfo.document, semanticInfo.snapshot, m_modelManager->importPaths());
ScopeBuilder scopeBuilder(semanticInfo.document, &context);
scopeBuilder.push(semanticInfo.astPath(cursorPosition));
Evaluate check(&context);
const Interpreter::Value *value = check.reference(node);
QString fileName; QString fileName;
int line = 0, column = 0; 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