forked from qt-creator/qt-creator
Clang: Don't send multiple completions for the same position
If we send already a completion we should test if there is already one sent for the same position. Change-Id: Ie88f89bff0e1da1c5e747827a45154c7ccaecabc Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com> Reviewed-by: Marco Bubke <marco.bubke@theqtcompany.com>
This commit is contained in:
@@ -263,14 +263,8 @@ void CodeAssistantPrivate::requestProposal(AssistReason reason,
|
||||
case IAssistProvider::Asynchronous: {
|
||||
processor->setAsyncCompletionAvailableHandler(
|
||||
[this, processor, reason](IAssistProposal *newProposal){
|
||||
if (m_asyncProcessor != processor) {
|
||||
delete newProposal->model();
|
||||
delete newProposal;
|
||||
return;
|
||||
}
|
||||
|
||||
invalidateCurrentRequestData();
|
||||
QTC_CHECK(newProposal);
|
||||
invalidateCurrentRequestData();
|
||||
displayProposal(newProposal, reason);
|
||||
|
||||
emit q->finished();
|
||||
@@ -282,10 +276,10 @@ void CodeAssistantPrivate::requestProposal(AssistReason reason,
|
||||
delete processor;
|
||||
} else if (!processor->performWasApplicable()) {
|
||||
delete processor;
|
||||
} else { // ...async request was triggered
|
||||
m_asyncProcessor = processor;
|
||||
}
|
||||
|
||||
// ...otherwise the async request was triggered
|
||||
m_asyncProcessor = processor;
|
||||
break;
|
||||
}
|
||||
} // switch
|
||||
|
||||
Reference in New Issue
Block a user