QmlJSEditor: jump to file under cursor if it exists

Don't limit this functionality to files that are part of the snapshot,
but try to open all files. This will allow opening c++ files defined in
a qbs project file.

Fixes: QTCREATORBUG-22685
Change-Id: If2a2a2075e5d7113a7bb44625c0f29ef66138d3c
Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
David Schulz
2020-04-03 15:03:26 +02:00
parent e3a0fe71e4
commit dee0997d38

View File

@@ -791,7 +791,7 @@ void QmlJSEditorWidget::findLinkAt(const QTextCursor &cursor,
const QString relative = QString::fromLatin1("%1/%2").arg( const QString relative = QString::fromLatin1("%1/%2").arg(
semanticInfo.document->path(), semanticInfo.document->path(),
text); text);
if (semanticInfo.snapshot.document(relative)) { if (QFileInfo::exists(relative)) {
link.targetFileName = relative; link.targetFileName = relative;
processLinkCallback(link); processLinkCallback(link);
return; return;