aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/texteditor/codeassist
diff options
context:
space:
mode:
authorEike Ziller <eike.ziller@qt.io>2023-05-05 10:39:47 +0200
committerEike Ziller <eike.ziller@qt.io>2023-05-05 10:39:47 +0200
commit7724f8653f9c0e5625179ecda8a545cb30f4e1b4 (patch)
treecbe5b15de32a6df7012bafb6f4e853ab9c21c676 /src/plugins/texteditor/codeassist
parent15193d3250834f85d90b790c0c40632e6de65033 (diff)
parentb083a4d55efbf9f6558034c0ce4efe31062e0e5b (diff)
Merge remote-tracking branch 'origin/10.0'
Diffstat (limited to 'src/plugins/texteditor/codeassist')
-rw-r--r--src/plugins/texteditor/codeassist/codeassistant.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/plugins/texteditor/codeassist/codeassistant.cpp b/src/plugins/texteditor/codeassist/codeassistant.cpp
index b81161dd6a..bbcbb130be 100644
--- a/src/plugins/texteditor/codeassist/codeassistant.cpp
+++ b/src/plugins/texteditor/codeassist/codeassistant.cpp
@@ -175,8 +175,7 @@ void CodeAssistantPrivate::requestProposal(AssistReason reason,
std::unique_ptr<AssistInterface> assistInterface =
m_editorWidget->createAssistInterface(kind, reason);
- if (!assistInterface)
- return;
+ QTC_ASSERT(assistInterface, return);
// We got an assist provider and interface so no need to reset the current context anymore
earlyReturnContextClear.reset({});
@@ -403,8 +402,10 @@ void CodeAssistantPrivate::notifyChange()
if (m_editorWidget->position() < m_proposalWidget->basePosition()) {
destroyContext();
} else {
- m_proposalWidget->updateProposal(
- m_editorWidget->createAssistInterface(m_assistKind, m_proposalWidget->reason()));
+ std::unique_ptr<AssistInterface> assistInterface
+ = m_editorWidget->createAssistInterface(m_assistKind, m_proposalWidget->reason());
+ QTC_ASSERT(assistInterface, destroyContext(); return);
+ m_proposalWidget->updateProposal(std::move(assistInterface));
if (!isDisplayingProposal())
requestActivationCharProposal();
}