CppTools: Do not auto-trigger completion after '{' and '(' in the new line

There's no token before the first symbol in the line.
With no information it's better to avoid triggering
automatic completion after the first token.

Change-Id: I9d3aca3bf72485c6eca6e03d9b8691abf0492bcc
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
This commit is contained in:
Ivan Donchevskii
2018-08-31 14:25:37 +02:00
parent d61d29cf16
commit b23bb73bee

View File

@@ -161,9 +161,12 @@ void CppCompletionAssistProcessor::startOfOperator(QTextDocument *textDocument,
*kind = T_EOF_SYMBOL;
start = positionInDocument;
}
} else {
*kind = T_EOF_SYMBOL;
start = positionInDocument;
}
} else if (*kind == T_LBRACE) {
if (tokenIdx > 0 && !twoIndentifiersBeforeLBrace(tokens, tokenIdx)) {
if (tokenIdx <= 0 || !twoIndentifiersBeforeLBrace(tokens, tokenIdx)) {
*kind = T_EOF_SYMBOL;
start = positionInDocument;
}