Commit 6b504c61 authored by Erik Verbruggen's avatar Erik Verbruggen
Browse files

Changed navigation back for now.

parent 0b2b6f96
......@@ -716,35 +716,35 @@ TextEditor::BaseTextEditor::Link ScriptEditor::findLinkAt(const QTextCursor &cur
if (!doc)
return link;
// NavigationTokenFinder finder;
// finder(doc, cursor.position(), snapshot);
// if (finder.targetFound()) {
// link.fileName = finder.fileName();
// link.pos = finder.linkPosition();
// link.length = finder.linkLength();
NavigationTokenFinder finder;
finder(doc, cursor.position(), snapshot);
if (finder.targetFound()) {
link.fileName = finder.fileName();
link.pos = finder.linkPosition();
link.length = finder.linkLength();
if (resolveTarget) {
link.line = finder.targetLine();
link.column = finder.targetColumn() - 1;
}
}
// QmlExpressionUnderCursor expressionUnderCursor;
// expressionUnderCursor(cursor, doc->program());
//
// if (resolveTarget) {
// link.line = finder.targetLine();
// link.column = finder.targetColumn() - 1;
// QmlLookupContext context(expressionUnderCursor.expressionScopes(),
// expressionUnderCursor.expressionNode(),
// doc, snapshot);
//
// ResolveQmlExpression resolve(context);
// if (QmlLookupContext::Symbol *symbol = resolve(expressionUnderCursor.expressionNode())) {
// if (UiObjectMember *member = static_cast<UiObjectMember *>(symbol)) { // ### FIXME: don't use static_cast<>
// const int begin = member->firstSourceLocation().begin();
// const int end = member->lastSourceLocation().end();
// qDebug() << doc->source().mid(begin, end - begin);
// }
// }
QmlExpressionUnderCursor expressionUnderCursor;
expressionUnderCursor(cursor, doc->program());
QmlLookupContext context(expressionUnderCursor.expressionScopes(),
expressionUnderCursor.expressionNode(),
doc, snapshot);
ResolveQmlExpression resolve(context);
if (QmlLookupContext::Symbol *symbol = resolve(expressionUnderCursor.expressionNode())) {
if (UiObjectMember *member = static_cast<UiObjectMember *>(symbol)) { // ### FIXME: don't use static_cast<>
const int begin = member->firstSourceLocation().begin();
const int end = member->lastSourceLocation().end();
qDebug() << doc->source().mid(begin, end - begin);
}
}
return link;
}
......
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