Make the way completion is triggered configurable

Now it's possible to choose between having completion popup manually,
when triggered or always.
This commit is contained in:
Thorbjørn Lindeijer
2010-07-15 16:05:43 +02:00
parent 2c51e0c9da
commit e101d8eccc
8 changed files with 151 additions and 78 deletions

View File

@@ -40,6 +40,7 @@
#include <qmljs/qmljsscopebuilder.h>
#include <texteditor/basetexteditor.h>
#include <texteditor/completionsettings.h>
#include <coreplugin/icore.h>
#include <coreplugin/editormanager/editormanager.h>
@@ -546,6 +547,8 @@ bool CodeCompletion::maybeTriggersCompletion(TextEditor::ITextEditable *editor)
if (ch == QLatin1Char('(') || ch == QLatin1Char('.'))
return true;
if (completionSettings().m_completionTrigger != TextEditor::AutomaticCompletion)
return false;
const QChar characterUnderCursor = editor->characterAt(cursorPosition);