TextEditor: Allow incremental proposals

... and make use of them with clangd.
This way, users can get immediate feedback when a new proposal entry
has been found, rather than having to wait until all of them have been
collected.

Change-Id: I2adfe0153aa7a058f28eb3bd65c71dd30ea018e0
Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
Christian Kandeler
2021-05-31 11:21:30 +02:00
parent 58f984d2b9
commit dc4a8b3866
5 changed files with 108 additions and 78 deletions

View File

@@ -61,8 +61,9 @@ public:
bool gotResults = false;
processor->setAsyncCompletionAvailableHandler(
[this, &gotResults] (TextEditor::IAssistProposal *proposal) {
[this, processor, &gotResults] (TextEditor::IAssistProposal *proposal) {
QTC_ASSERT(proposal, return);
QTC_CHECK(!processor->running());
proposalModel = proposal->model();
delete proposal;
gotResults = true;