Merge CppTools into CppEditor

There was no proper separation of responsibilities between these
plugins. In particular, CppTools had lots of editor-related
functionality, so it's not clear why it was separated out in the first
place.
In fact, for a lot of code, it seemed quite arbitrary where it was put
(just one example: switchHeaderSource() was in CppTools, wheras
switchDeclarationDefinition() was in CppEditor).
Merging the plugins will enable us to get rid of various convoluted
pseudo-abstractions that were only introduced to keep up the artificial
separation.

Change-Id: Iafc3bce625b4794f6d4aa03df6cddc7f2d26716a
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
Christian Kandeler
2021-08-30 10:58:08 +02:00
parent 3e1fa0f170
commit 284817fae6
525 changed files with 3705 additions and 4179 deletions

View File

@@ -1,6 +1,6 @@
add_qtc_plugin(CMakeProjectManager
DEPENDS QmlJS
PLUGIN_DEPENDS Core CppTools ProjectExplorer TextEditor QtSupport
PLUGIN_DEPENDS Core CppEditor ProjectExplorer TextEditor QtSupport
PLUGIN_RECOMMENDS Designer
SOURCES
builddirparameters.cpp builddirparameters.h

View File

@@ -40,9 +40,9 @@
#include <coreplugin/icore.h>
#include <coreplugin/progressmanager/progressmanager.h>
#include <coreplugin/reaper.h>
#include <cpptools/cppprojectupdater.h>
#include <cpptools/cpptoolsconstants.h>
#include <cpptools/generatedcodemodelsupport.h>
#include <cppeditor/cppeditorconstants.h>
#include <cppeditor/cppprojectupdater.h>
#include <cppeditor/generatedcodemodelsupport.h>
#include <projectexplorer/kitinformation.h>
#include <projectexplorer/projectexplorer.h>
#include <projectexplorer/projectexplorerconstants.h>
@@ -93,10 +93,10 @@ static void noAutoAdditionNotify(const FilePaths &filePaths, const ProjectNode *
{
const FilePaths srcPaths = Utils::filtered(filePaths, [](const FilePath &file) {
const auto mimeType = Utils::mimeTypeForFile(file).name();
return mimeType == CppTools::Constants::C_SOURCE_MIMETYPE ||
mimeType == CppTools::Constants::C_HEADER_MIMETYPE ||
mimeType == CppTools::Constants::CPP_SOURCE_MIMETYPE ||
mimeType == CppTools::Constants::CPP_HEADER_MIMETYPE ||
return mimeType == CppEditor::Constants::C_SOURCE_MIMETYPE ||
mimeType == CppEditor::Constants::C_HEADER_MIMETYPE ||
mimeType == CppEditor::Constants::CPP_SOURCE_MIMETYPE ||
mimeType == CppEditor::Constants::CPP_HEADER_MIMETYPE ||
mimeType == ProjectExplorer::Constants::FORM_MIMETYPE ||
mimeType == ProjectExplorer::Constants::RESOURCE_MIMETYPE ||
mimeType == ProjectExplorer::Constants::SCXML_MIMETYPE;
@@ -151,7 +151,7 @@ static Q_LOGGING_CATEGORY(cmakeBuildSystemLog, "qtc.cmake.buildsystem", QtWarnin
CMakeBuildSystem::CMakeBuildSystem(CMakeBuildConfiguration *bc)
: BuildSystem(bc)
, m_cppCodeModelUpdater(new CppTools::CppProjectUpdater)
, m_cppCodeModelUpdater(new CppEditor::CppProjectUpdater)
{
// TreeScanner:
connect(&m_treeScanner, &TreeScanner::finished,

View File

@@ -36,12 +36,9 @@
#include <utils/futuresynchronizer.h>
#include <utils/temporarydirectory.h>
namespace CppEditor { class CppProjectUpdater; }
namespace ProjectExplorer { class ExtraCompiler; }
namespace CppTools {
class CppProjectUpdater;
} // namespace CppTools
namespace CMakeProjectManager {
class CMakeBuildConfiguration;
@@ -169,7 +166,7 @@ private:
ParseGuard m_currentGuard;
CppTools::CppProjectUpdater *m_cppCodeModelUpdater = nullptr;
CppEditor::CppProjectUpdater *m_cppCodeModelUpdater = nullptr;
QList<ProjectExplorer::ExtraCompiler *> m_extraCompilers;
QList<CMakeBuildTarget> m_buildTargets;

View File

@@ -7,7 +7,7 @@ QtcPlugin {
Depends { name: "Utils" }
Depends { name: "Core" }
Depends { name: "CppTools" }
Depends { name: "CppEditor" }
Depends { name: "QmlJS" }
Depends { name: "ProjectExplorer" }
Depends { name: "TextEditor" }

View File

@@ -6,7 +6,7 @@ QTC_LIB_DEPENDS += \
QTC_PLUGIN_DEPENDS += \
coreplugin \
projectexplorer \
cpptools \
cppeditor \
texteditor \
qtsupport
QTC_PLUGIN_RECOMMENDS += \