forked from qt-creator/qt-creator
TextEditor: Move CompletionAssistProvider construction
... to the editor factories and pass it to the document, not the widget. Saves some code, puts fewer objects into the object pool. Change-Id: Iaaf250af74dc4e0c62700873accbb40ba88b7d9e Reviewed-by: Christian Stenger <christian.stenger@digia.com> Reviewed-by: David Schulz <david.schulz@digia.com>
This commit is contained in:
@@ -48,20 +48,6 @@
|
||||
namespace Android {
|
||||
namespace Internal {
|
||||
|
||||
//
|
||||
// JavaEditorWidget
|
||||
//
|
||||
|
||||
class JavaEditorWidget : public TextEditor::TextEditorWidget
|
||||
{
|
||||
public:
|
||||
JavaEditorWidget()
|
||||
{
|
||||
setCompletionAssistProvider(ExtensionSystem::PluginManager::getObject<JavaCompletionAssistProvider>());
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
//
|
||||
// JavaDocument
|
||||
//
|
||||
@@ -106,12 +92,11 @@ JavaEditorFactory::JavaEditorFactory()
|
||||
addMimeType(Constants::JAVA_MIMETYPE);
|
||||
|
||||
setDocumentCreator([]() { return new JavaDocument; });
|
||||
setEditorWidgetCreator([]() { return new JavaEditorWidget; });
|
||||
setAutoCompleterCreator([]() { return new JavaAutoCompleter; });
|
||||
setGenericSyntaxHighlighter(QLatin1String(Constants::JAVA_MIMETYPE));
|
||||
setCommentStyle(Utils::CommentDefinition::CppStyle);
|
||||
|
||||
setEditorActionHandlers(TextEditor::TextEditorActionHandler::UnCommentSelection);
|
||||
setCompletionAssistProvider(new JavaCompletionAssistProvider);
|
||||
}
|
||||
|
||||
} // namespace Internal
|
||||
|
||||
Reference in New Issue
Block a user