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

@@ -25,9 +25,12 @@
#include "cpptoolsreuse.h"
#include "cppautocompleter.h"
#include "cppcodemodelsettings.h"
#include "cppeditorconstants.h"
#include "cppeditorplugin.h"
#include "cpphighlighter.h"
#include "cppqtstyleindenter.h"
#include "cpprefactoringchanges.h"
#include "projectinfo.h"
@@ -36,6 +39,7 @@
#include <coreplugin/idocument.h>
#include <coreplugin/messagemanager.h>
#include <projectexplorer/session.h>
#include <texteditor/textdocument.h>
#include <cplusplus/Overview.h>
#include <cplusplus/LookupContext.h>
@@ -584,4 +588,15 @@ ProjectExplorer::Project *projectForProjectInfo(const ProjectInfo &info)
return ProjectExplorer::SessionManager::projectWithProjectFilePath(info.projectFilePath());
}
namespace Internal {
void decorateCppEditor(TextEditor::TextEditorWidget *editor)
{
editor->textDocument()->setSyntaxHighlighter(new CppHighlighter);
editor->textDocument()->setIndenter(
new CppQtStyleIndenter(editor->textDocument()->document()));
editor->setAutoCompleter(new CppAutoCompleter);
}
} // namespace Internal
} // CppEditor