forked from qt-creator/qt-creator
CodeAssist: Do not retrigger completion when applying a snippet
This fixes the following case for the ClangCodeModel:
1. Trigger non-member/non-prefix completion.
2. Choose the generic "class" snippet.
--> The snippet is inserted, cursor is right after "name", but it
also triggers another completion that proposes e.g. the "namespace"
snippet.
This does not happen with the built-in code model because at that cursor
position it provides "name" as completion result, which is a perfect
match and thus suppresses the completion list.
Change-Id: I2f797469b2a0952406b50c28f9704b113e19b16d
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
@@ -350,7 +350,8 @@ void CodeAssistantPrivate::processProposalItem(AssistProposalItemInterface *prop
|
||||
TextDocumentManipulator manipulator(m_editorWidget);
|
||||
proposalItem->apply(manipulator, m_proposal->basePosition());
|
||||
destroyContext();
|
||||
process();
|
||||
if (!proposalItem->isSnippet())
|
||||
process();
|
||||
}
|
||||
|
||||
void CodeAssistantPrivate::handlePrefixExpansion(const QString &newPrefix)
|
||||
|
||||
Reference in New Issue
Block a user