forked from qt-creator/qt-creator
LSP: rerequest completion if contents change while processing
Task-number: QTCREATORBUG-21108 Change-Id: I6ca7920e7099dba0ba1bc953a2e6296bd86c1dc1 Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
@@ -245,10 +245,17 @@ void CodeAssistantPrivate::requestProposal(AssistReason reason,
|
||||
case IAssistProvider::Asynchronous: {
|
||||
processor->setAsyncCompletionAvailableHandler(
|
||||
[this, reason](IAssistProposal *newProposal){
|
||||
invalidateCurrentRequestData();
|
||||
displayProposal(newProposal, reason);
|
||||
if (m_asyncProcessor && m_asyncProcessor->needsRestart() && m_receivedContentWhileWaiting) {
|
||||
delete newProposal;
|
||||
m_receivedContentWhileWaiting = false;
|
||||
invalidateCurrentRequestData();
|
||||
requestProposal(reason, m_assistKind, m_requestProvider);
|
||||
} else {
|
||||
invalidateCurrentRequestData();
|
||||
displayProposal(newProposal, reason);
|
||||
|
||||
emit q->finished();
|
||||
emit q->finished();
|
||||
}
|
||||
});
|
||||
|
||||
// If there is a proposal, nothing asynchronous happened...
|
||||
|
||||
Reference in New Issue
Block a user