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 ...@@ -716,35 +716,35 @@ TextEditor::BaseTextEditor::Link ScriptEditor::findLinkAt(const QTextCursor &cur
if (!doc) if (!doc)
return link; return link;
// NavigationTokenFinder finder; NavigationTokenFinder finder;
// finder(doc, cursor.position(), snapshot); finder(doc, cursor.position(), snapshot);
// if (finder.targetFound()) { if (finder.targetFound()) {
// link.fileName = finder.fileName(); link.fileName = finder.fileName();
// link.pos = finder.linkPosition(); link.pos = finder.linkPosition();
// link.length = finder.linkLength(); link.length = finder.linkLength();
if (resolveTarget) {
link.line = finder.targetLine();
link.column = finder.targetColumn() - 1;
}
}
// QmlExpressionUnderCursor expressionUnderCursor;
// expressionUnderCursor(cursor, doc->program());
// //
// if (resolveTarget) { // QmlLookupContext context(expressionUnderCursor.expressionScopes(),
// link.line = finder.targetLine(); // expressionUnderCursor.expressionNode(),
// link.column = finder.targetColumn() - 1; // 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; 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