forked from qt-creator/qt-creator
Snippets: Set auto-completers.
This commit is contained in:
@@ -31,6 +31,7 @@
|
|||||||
#include "cpphighlighter.h"
|
#include "cpphighlighter.h"
|
||||||
#include "cppeditor.h"
|
#include "cppeditor.h"
|
||||||
#include "cppqtstyleindenter.h"
|
#include "cppqtstyleindenter.h"
|
||||||
|
#include "cppautocompleter.h"
|
||||||
|
|
||||||
#include <texteditor/texteditorsettings.h>
|
#include <texteditor/texteditorsettings.h>
|
||||||
#include <texteditor/fontsettings.h>
|
#include <texteditor/fontsettings.h>
|
||||||
@@ -62,6 +63,6 @@ void CppSnippetEditorDecorator::apply(TextEditor::SnippetEditor *editor) const
|
|||||||
fs.toTextCharFormats(CPPEditor::highlighterFormatCategories());
|
fs.toTextCharFormats(CPPEditor::highlighterFormatCategories());
|
||||||
highlighter->setFormats(formats.constBegin(), formats.constEnd());
|
highlighter->setFormats(formats.constBegin(), formats.constEnd());
|
||||||
editor->installSyntaxHighlighter(highlighter);
|
editor->installSyntaxHighlighter(highlighter);
|
||||||
|
|
||||||
editor->setIndenter(new CppQtStyleIndenter);
|
editor->setIndenter(new CppQtStyleIndenter);
|
||||||
|
editor->setAutoCompleter(new CppAutoCompleter);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -31,6 +31,7 @@
|
|||||||
#include "qmljshighlighter.h"
|
#include "qmljshighlighter.h"
|
||||||
#include "qmljseditor.h"
|
#include "qmljseditor.h"
|
||||||
#include "qmljsindenter.h"
|
#include "qmljsindenter.h"
|
||||||
|
#include "qmljsautocompleter.h"
|
||||||
|
|
||||||
#include <texteditor/texteditorsettings.h>
|
#include <texteditor/texteditorsettings.h>
|
||||||
#include <texteditor/fontsettings.h>
|
#include <texteditor/fontsettings.h>
|
||||||
@@ -60,6 +61,6 @@ void QmlJSSnippetEditorDecorator::apply(TextEditor::SnippetEditor *editor) const
|
|||||||
const TextEditor::FontSettings &fs = TextEditor::TextEditorSettings::instance()->fontSettings();
|
const TextEditor::FontSettings &fs = TextEditor::TextEditorSettings::instance()->fontSettings();
|
||||||
highlighter->setFormats(fs.toTextCharFormats(QmlJSTextEditor::highlighterFormatCategories()));
|
highlighter->setFormats(fs.toTextCharFormats(QmlJSTextEditor::highlighterFormatCategories()));
|
||||||
editor->installSyntaxHighlighter(highlighter);
|
editor->installSyntaxHighlighter(highlighter);
|
||||||
|
|
||||||
editor->setIndenter(new Indenter);
|
editor->setIndenter(new Indenter);
|
||||||
|
editor->setAutoCompleter(new AutoCompleter);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user