OSDN Git Service

Snippets: Set auto-completers.
authorLeandro Melo <leandro.melo@nokia.com>
Tue, 9 Nov 2010 10:44:49 +0000 (11:44 +0100)
committerLeandro Melo <leandro.melo@nokia.com>
Wed, 8 Dec 2010 16:22:09 +0000 (17:22 +0100)
src/plugins/cppeditor/cppsnippeteditordecorator.cpp
src/plugins/qmljseditor/qmljssnippeteditordecorator.cpp

index 31acb5d..b3327a6 100644 (file)
@@ -31,6 +31,7 @@
 #include "cpphighlighter.h"
 #include "cppeditor.h"
 #include "cppqtstyleindenter.h"
+#include "cppautocompleter.h"
 
 #include <texteditor/texteditorsettings.h>
 #include <texteditor/fontsettings.h>
@@ -62,6 +63,6 @@ void CppSnippetEditorDecorator::apply(TextEditor::SnippetEditor *editor) const
         fs.toTextCharFormats(CPPEditor::highlighterFormatCategories());
     highlighter->setFormats(formats.constBegin(), formats.constEnd());
     editor->installSyntaxHighlighter(highlighter);
-
     editor->setIndenter(new CppQtStyleIndenter);
+    editor->setAutoCompleter(new CppAutoCompleter);
 }
index ef0ad82..6275ca3 100644 (file)
@@ -31,6 +31,7 @@
 #include "qmljshighlighter.h"
 #include "qmljseditor.h"
 #include "qmljsindenter.h"
+#include "qmljsautocompleter.h"
 
 #include <texteditor/texteditorsettings.h>
 #include <texteditor/fontsettings.h>
@@ -60,6 +61,6 @@ void QmlJSSnippetEditorDecorator::apply(TextEditor::SnippetEditor *editor) const
     const TextEditor::FontSettings &fs = TextEditor::TextEditorSettings::instance()->fontSettings();
     highlighter->setFormats(fs.toTextCharFormats(QmlJSTextEditor::highlighterFormatCategories()));
     editor->installSyntaxHighlighter(highlighter);
-
     editor->setIndenter(new Indenter);
+    editor->setAutoCompleter(new AutoCompleter);
 }