ClangCodeModel: Fix following virtual functions

Don't indirectly trigger the regular callback once the proposal widget
was shown.
Amends 09e495f01a.

Change-Id: I9d2411f88c69488d63462318f48cef4a0eeeaed1
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
Christian Kandeler
2023-11-30 17:21:44 +01:00
parent 5d14e580ea
commit 73f8854263

View File

@@ -39,11 +39,11 @@ public:
VirtualFunctionAssistProcessor(ClangdFollowSymbol *followSymbol)
: m_followSymbol(followSymbol) {}
void cancel() override { resetData(true); }
void cancel() override { resetData(); }
bool running() override { return m_followSymbol && m_running; }
void update();
void finalize();
void resetData(bool resetFollowSymbolData);
void resetData();
private:
IAssistProposal *perform() override
@@ -228,7 +228,7 @@ void ClangdFollowSymbol::Private::cancel()
{
closeTempDocuments();
if (virtualFuncAssistProcessor)
virtualFuncAssistProcessor->resetData(false);
virtualFuncAssistProcessor->resetData();
for (const MessageId &id : std::as_const(pendingSymbolInfoRequests))
client->cancelRequest(id);
for (const MessageId &id : std::as_const(pendingGotoImplRequests))
@@ -301,16 +301,14 @@ void ClangdFollowSymbol::VirtualFunctionAssistProcessor::finalize()
} else {
setAsyncProposalAvailable(proposal);
}
resetData(true);
resetData();
}
void ClangdFollowSymbol::VirtualFunctionAssistProcessor::resetData(bool resetFollowSymbolData)
void ClangdFollowSymbol::VirtualFunctionAssistProcessor::resetData()
{
if (!m_followSymbol)
return;
m_followSymbol->d->virtualFuncAssistProcessor = nullptr;
if (resetFollowSymbolData)
m_followSymbol->emitDone();
m_followSymbol = nullptr;
}