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

@@ -25,8 +25,8 @@
#pragma once
#include <cpptools/cppcodemodelsettings.h>
#include <cpptools/refactoringengineinterface.h>
#include <cppeditor/cppcodemodelsettings.h>
#include <cppeditor/refactoringengineinterface.h>
#include <languageclient/client.h>
#include <utils/link.h>
#include <utils/optional.h>
@@ -34,7 +34,7 @@
#include <QVersionNumber>
namespace Core { class SearchResultItem; }
namespace CppTools { class CppEditorWidgetInterface; }
namespace CppEditor { class CppEditorWidgetInterface; }
namespace ProjectExplorer { class Project; }
namespace TextEditor { class BaseTextEditor; }
@@ -50,7 +50,7 @@ public:
bool isFullyIndexed() const;
QVersionNumber versionNumber() const;
CppTools::ClangdSettings::Data settingsData() const;
CppEditor::ClangdSettings::Data settingsData() const;
void openEditorDocument(TextEditor::BaseTextEditor *editor);
@@ -61,18 +61,18 @@ public:
const Utils::optional<QString> &replacement);
void followSymbol(TextEditor::TextDocument *document,
const QTextCursor &cursor,
CppTools::CppEditorWidgetInterface *editorWidget,
CppEditor::CppEditorWidgetInterface *editorWidget,
Utils::ProcessLinkCallback &&callback,
bool resolveTarget,
bool openInSplit);
void switchDeclDef(TextEditor::TextDocument *document,
const QTextCursor &cursor,
CppTools::CppEditorWidgetInterface *editorWidget,
CppEditor::CppEditorWidgetInterface *editorWidget,
Utils::ProcessLinkCallback &&callback);
void findLocalUsages(TextEditor::TextDocument *document, const QTextCursor &cursor,
CppTools::RefactoringEngineInterface::RenameCallback &&callback);
CppEditor::RefactoringEngineInterface::RenameCallback &&callback);
void gatherHelpItemForTooltip(
const LanguageServerProtocol::HoverRequest::Response &hoverResponse,