forked from qt-creator/qt-creator
ClangCodeModel: Fix following virtual functions
Amends 79b8e5397d
.
Change-Id: I8c4e3c7cb8cb26d51cdf77c15891110c6b213d46
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
@@ -134,6 +134,7 @@ public:
|
|||||||
SymbolDataList symbolsToDisplay;
|
SymbolDataList symbolsToDisplay;
|
||||||
std::set<FilePath> openedFiles;
|
std::set<FilePath> openedFiles;
|
||||||
VirtualFunctionAssistProcessor *virtualFuncAssistProcessor = nullptr;
|
VirtualFunctionAssistProcessor *virtualFuncAssistProcessor = nullptr;
|
||||||
|
QMetaObject::Connection focusChangedConnection;
|
||||||
bool finished = false;
|
bool finished = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -151,7 +152,7 @@ ClangdFollowSymbol::ClangdFollowSymbol(ClangdClient *client, const QTextCursor &
|
|||||||
connect(editorWidget, &CppEditorWidget::cursorPositionChanged,
|
connect(editorWidget, &CppEditorWidget::cursorPositionChanged,
|
||||||
this, &ClangdFollowSymbol::done, Qt::QueuedConnection);
|
this, &ClangdFollowSymbol::done, Qt::QueuedConnection);
|
||||||
}
|
}
|
||||||
connect(qApp, &QApplication::focusChanged,
|
d->focusChangedConnection = connect(qApp, &QApplication::focusChanged,
|
||||||
this, &ClangdFollowSymbol::done, Qt::QueuedConnection);
|
this, &ClangdFollowSymbol::done, Qt::QueuedConnection);
|
||||||
|
|
||||||
// Step 1: Follow the symbol via "Go to Definition". At the same time, request the
|
// Step 1: Follow the symbol via "Go to Definition". At the same time, request the
|
||||||
@@ -413,8 +414,10 @@ void ClangdFollowSymbol::Private::handleGotoImplementationResult(
|
|||||||
|
|
||||||
// As soon as we know that there is more than one candidate, we start the code assist
|
// As soon as we know that there is more than one candidate, we start the code assist
|
||||||
// procedure, to let the user know that things are happening.
|
// procedure, to let the user know that things are happening.
|
||||||
if (allLinks.size() > 1 && !virtualFuncAssistProcessor && editorWidget)
|
if (allLinks.size() > 1 && !virtualFuncAssistProcessor && editorWidget) {
|
||||||
|
QObject::disconnect(focusChangedConnection);
|
||||||
editorWidget->invokeTextEditorWidgetAssist(FollowSymbol, &virtualFuncAssistProvider);
|
editorWidget->invokeTextEditorWidgetAssist(FollowSymbol, &virtualFuncAssistProvider);
|
||||||
|
}
|
||||||
|
|
||||||
if (!pendingGotoImplRequests.isEmpty())
|
if (!pendingGotoImplRequests.isEmpty())
|
||||||
return;
|
return;
|
||||||
|
Reference in New Issue
Block a user