CppEditor: Remove class CppEditor

It's not needed, and conflicts with the namespace of the same name in
some contexts.

Change-Id: I281025abbfad0feb602f006e3b997a8b9c308b48
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
Christian Kandeler
2021-09-02 08:23:46 +02:00
parent f7aa963a07
commit 0a7aca5a71
23 changed files with 73 additions and 154 deletions

View File

@@ -30,7 +30,6 @@
#include "cppcodemodelsettings.h"
#include "cppcodemodelsettingspage.h"
#include "cppcodestylesettingspage.h"
#include "cppeditor.h"
#include "cppeditorconstants.h"
#include "cppeditordocument.h"
#include "cppeditorwidget.h"
@@ -97,11 +96,13 @@
#include <extensionsystem/pluginmanager.h>
#include <projectexplorer/project.h>
#include <projectexplorer/projectexplorerconstants.h>
#include <projectexplorer/projectpanelfactory.h>
#include <projectexplorer/projecttree.h>
#include <texteditor/colorpreviewhoverhandler.h>
#include <texteditor/snippets/snippetprovider.h>
#include <texteditor/texteditor.h>
#include <texteditor/texteditoractionhandler.h>
#include <texteditor/texteditorconstants.h>
@@ -158,7 +159,11 @@ public:
setDocumentCreator([]() { return new CppEditorDocument; });
setEditorWidgetCreator([]() { return new CppEditorWidget; });
setEditorCreator([]() { return new CppEditor; });
setEditorCreator([]() {
const auto editor = new BaseTextEditor;
editor->addContext(ProjectExplorer::Constants::CXX_LANGUAGE_ID);
return editor;
});
setAutoCompleterCreator([]() { return new CppAutoCompleter; });
setCommentDefinition(CommentDefinition::CppStyle);
setCodeFoldingSupported(true);
@@ -313,7 +318,7 @@ bool CppEditorPlugin::initialize(const QStringList & /*arguments*/, QString *err
ProjectPanelFactory::registerFactory(quickFixSettingsPanelFactory);
SnippetProvider::registerGroup(Constants::CPP_SNIPPETS_GROUP_ID, tr("C++", "SnippetProvider"),
&CppEditor::decorateEditor);
&decorateCppEditor);
createCppQuickFixes();
@@ -621,7 +626,7 @@ CppFileSettings *CppEditorPlugin::fileSettings()
void CppEditorPlugin::switchHeaderSource()
{
::CppEditor::switchHeaderSource();
CppEditor::switchHeaderSource();
}
void CppEditorPlugin::switchHeaderSourceInNextSplit()