forked from qt-creator/qt-creator
Editor: only close proposal widgets after updates
To prevent closing function hint widgets after the completion processor did not return a proposal. Change-Id: I1901f3f21917d348ef12a6db846739e3c54752fb Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
@@ -64,7 +64,10 @@ public:
|
|||||||
|
|
||||||
void invoke(AssistKind kind, IAssistProvider *provider = nullptr);
|
void invoke(AssistKind kind, IAssistProvider *provider = nullptr);
|
||||||
void process();
|
void process();
|
||||||
void requestProposal(AssistReason reason, AssistKind kind, IAssistProvider *provider = nullptr);
|
void requestProposal(AssistReason reason,
|
||||||
|
AssistKind kind,
|
||||||
|
IAssistProvider *provider = nullptr,
|
||||||
|
bool isUpdate = false);
|
||||||
void cancelCurrentRequest();
|
void cancelCurrentRequest();
|
||||||
void invalidateCurrentRequestData();
|
void invalidateCurrentRequestData();
|
||||||
void displayProposal(IAssistProposal *newProposal, AssistReason reason);
|
void displayProposal(IAssistProposal *newProposal, AssistReason reason);
|
||||||
@@ -192,7 +195,8 @@ void CodeAssistantPrivate::process()
|
|||||||
|
|
||||||
void CodeAssistantPrivate::requestProposal(AssistReason reason,
|
void CodeAssistantPrivate::requestProposal(AssistReason reason,
|
||||||
AssistKind kind,
|
AssistKind kind,
|
||||||
IAssistProvider *provider)
|
IAssistProvider *provider,
|
||||||
|
bool isUpdate)
|
||||||
{
|
{
|
||||||
// make sure to cleanup old proposals if we cannot find a new assistant
|
// make sure to cleanup old proposals if we cannot find a new assistant
|
||||||
Utils::ExecuteOnDestruction earlyReturnContextClear([this]() { destroyContext(); });
|
Utils::ExecuteOnDestruction earlyReturnContextClear([this]() { destroyContext(); });
|
||||||
@@ -284,7 +288,8 @@ void CodeAssistantPrivate::requestProposal(AssistReason reason,
|
|||||||
displayProposal(newProposal, reason);
|
displayProposal(newProposal, reason);
|
||||||
delete processor;
|
delete processor;
|
||||||
} else if (!processor->running()) {
|
} else if (!processor->running()) {
|
||||||
destroyContext();
|
if (isUpdate)
|
||||||
|
destroyContext();
|
||||||
delete processor;
|
delete processor;
|
||||||
} else { // ...async request was triggered
|
} else { // ...async request was triggered
|
||||||
if (IAssistProposal *newProposal = processor->immediateProposal(assistInterface))
|
if (IAssistProposal *newProposal = processor->immediateProposal(assistInterface))
|
||||||
@@ -487,7 +492,7 @@ void CodeAssistantPrivate::notifyChange()
|
|||||||
if (!isDisplayingProposal())
|
if (!isDisplayingProposal())
|
||||||
requestActivationCharProposal();
|
requestActivationCharProposal();
|
||||||
} else {
|
} else {
|
||||||
requestProposal(m_proposal->reason(), m_assistKind, m_requestProvider);
|
requestProposal(m_proposal->reason(), m_assistKind, m_requestProvider, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user