From dee0997d388c4f9674b07303904bfe740e3bfecb Mon Sep 17 00:00:00 2001 From: David Schulz Date: Fri, 3 Apr 2020 15:03:26 +0200 Subject: [PATCH] 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 Reviewed-by: Christian Kandeler --- src/plugins/qmljseditor/qmljseditor.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/qmljseditor/qmljseditor.cpp b/src/plugins/qmljseditor/qmljseditor.cpp index 9f1799eef27..16aaa6ec47f 100644 --- a/src/plugins/qmljseditor/qmljseditor.cpp +++ b/src/plugins/qmljseditor/qmljseditor.cpp @@ -791,7 +791,7 @@ void QmlJSEditorWidget::findLinkAt(const QTextCursor &cursor, const QString relative = QString::fromLatin1("%1/%2").arg( semanticInfo.document->path(), text); - if (semanticInfo.snapshot.document(relative)) { + if (QFileInfo::exists(relative)) { link.targetFileName = relative; processLinkCallback(link); return;