TextEditor: Make threshold for automatic completion configurable

Fixes: QTCREATORBUG-19920
Change-Id: Id6be79485b1fb8c2ab4cce2706816949ae5e217b
Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
Christian Kandeler
2020-08-03 16:19:19 +02:00
parent 7576ead1dd
commit 760d91665f
11 changed files with 214 additions and 136 deletions

View File

@@ -851,12 +851,12 @@ bool InternalCppCompletionAssistProcessor::accepts() const
return true;
} else {
// Trigger completion after three characters of a name have been typed, when not editing an existing name
// Trigger completion after n characters of a name have been typed, when not editing an existing name
QChar characterUnderCursor = m_interface->characterAt(pos);
if (!isValidIdentifierChar(characterUnderCursor)) {
const int startOfName = findStartOfName(pos);
if (pos - startOfName >= 3) {
if (pos - startOfName >= TextEditorSettings::completionSettings().m_characterThreshold) {
const QChar firstCharacter = m_interface->characterAt(startOfName);
if (isValidFirstIdentifierChar(firstCharacter)) {
// Finally check that we're not inside a comment or string (code copied from startOfOperator)