forked from qt-creator/qt-creator
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:
@@ -39,11 +39,11 @@ public:
|
|||||||
VirtualFunctionAssistProcessor(ClangdFollowSymbol *followSymbol)
|
VirtualFunctionAssistProcessor(ClangdFollowSymbol *followSymbol)
|
||||||
: m_followSymbol(followSymbol) {}
|
: m_followSymbol(followSymbol) {}
|
||||||
|
|
||||||
void cancel() override { resetData(true); }
|
void cancel() override { resetData(); }
|
||||||
bool running() override { return m_followSymbol && m_running; }
|
bool running() override { return m_followSymbol && m_running; }
|
||||||
void update();
|
void update();
|
||||||
void finalize();
|
void finalize();
|
||||||
void resetData(bool resetFollowSymbolData);
|
void resetData();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
IAssistProposal *perform() override
|
IAssistProposal *perform() override
|
||||||
@@ -228,7 +228,7 @@ void ClangdFollowSymbol::Private::cancel()
|
|||||||
{
|
{
|
||||||
closeTempDocuments();
|
closeTempDocuments();
|
||||||
if (virtualFuncAssistProcessor)
|
if (virtualFuncAssistProcessor)
|
||||||
virtualFuncAssistProcessor->resetData(false);
|
virtualFuncAssistProcessor->resetData();
|
||||||
for (const MessageId &id : std::as_const(pendingSymbolInfoRequests))
|
for (const MessageId &id : std::as_const(pendingSymbolInfoRequests))
|
||||||
client->cancelRequest(id);
|
client->cancelRequest(id);
|
||||||
for (const MessageId &id : std::as_const(pendingGotoImplRequests))
|
for (const MessageId &id : std::as_const(pendingGotoImplRequests))
|
||||||
@@ -301,16 +301,14 @@ void ClangdFollowSymbol::VirtualFunctionAssistProcessor::finalize()
|
|||||||
} else {
|
} else {
|
||||||
setAsyncProposalAvailable(proposal);
|
setAsyncProposalAvailable(proposal);
|
||||||
}
|
}
|
||||||
resetData(true);
|
resetData();
|
||||||
}
|
}
|
||||||
|
|
||||||
void ClangdFollowSymbol::VirtualFunctionAssistProcessor::resetData(bool resetFollowSymbolData)
|
void ClangdFollowSymbol::VirtualFunctionAssistProcessor::resetData()
|
||||||
{
|
{
|
||||||
if (!m_followSymbol)
|
if (!m_followSymbol)
|
||||||
return;
|
return;
|
||||||
m_followSymbol->d->virtualFuncAssistProcessor = nullptr;
|
m_followSymbol->d->virtualFuncAssistProcessor = nullptr;
|
||||||
if (resetFollowSymbolData)
|
|
||||||
m_followSymbol->emitDone();
|
|
||||||
m_followSymbol = nullptr;
|
m_followSymbol = nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user