forked from qt-creator/qt-creator
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:
@@ -3,7 +3,7 @@ find_package(yaml-cpp QUIET MODULE)
|
||||
add_qtc_plugin(ClangTools
|
||||
CONDITION TARGET yaml-cpp
|
||||
DEPENDS ClangSupport yaml-cpp
|
||||
PLUGIN_DEPENDS Core Debugger CppTools CppEditor
|
||||
PLUGIN_DEPENDS Core Debugger CppEditor
|
||||
PLUGIN_RECOMMENDS CppEditor
|
||||
PLUGIN_TEST_DEPENDS QmakeProjectManager QbsProjectManager
|
||||
INCLUDES ${CLANG_INCLUDE_DIRS}
|
||||
|
||||
@@ -25,8 +25,8 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <cpptools/cppprojectfile.h>
|
||||
#include <cpptools/projectpart.h>
|
||||
#include <cppeditor/cppprojectfile.h>
|
||||
#include <cppeditor/projectpart.h>
|
||||
|
||||
#include <utils/fileutils.h>
|
||||
|
||||
@@ -40,15 +40,15 @@ class FileInfo
|
||||
public:
|
||||
FileInfo() = default;
|
||||
FileInfo(Utils::FilePath file,
|
||||
CppTools::ProjectFile::Kind kind,
|
||||
CppTools::ProjectPart::ConstPtr projectPart)
|
||||
CppEditor::ProjectFile::Kind kind,
|
||||
CppEditor::ProjectPart::ConstPtr projectPart)
|
||||
: file(std::move(file))
|
||||
, kind(kind)
|
||||
, projectPart(projectPart)
|
||||
{}
|
||||
Utils::FilePath file;
|
||||
CppTools::ProjectFile::Kind kind;
|
||||
CppTools::ProjectPart::ConstPtr projectPart;
|
||||
CppEditor::ProjectFile::Kind kind;
|
||||
CppEditor::ProjectPart::ConstPtr projectPart;
|
||||
};
|
||||
using FileInfos = std::vector<FileInfo>;
|
||||
|
||||
|
||||
@@ -26,9 +26,9 @@
|
||||
#include "clangfixitsrefactoringchanges.h"
|
||||
|
||||
#include <coreplugin/editormanager/editormanager.h>
|
||||
#include <cpptools/cppcodestylesettings.h>
|
||||
#include <cpptools/cppmodelmanager.h>
|
||||
#include <cpptools/cpptoolsconstants.h>
|
||||
#include <cppeditor/cppcodestylesettings.h>
|
||||
#include <cppeditor/cppeditorconstants.h>
|
||||
#include <cppeditor/cppmodelmanager.h>
|
||||
|
||||
#include <texteditor/icodestylepreferencesfactory.h>
|
||||
#include <texteditor/indenter.h>
|
||||
@@ -79,7 +79,7 @@ bool FixitsRefactoringFile::apply()
|
||||
return false; // Error nothing to apply TODO: Is this correct to return?
|
||||
|
||||
ICodeStylePreferencesFactory *factory = TextEditorSettings::codeStyleFactory(
|
||||
CppTools::Constants::CPP_SETTINGS_ID);
|
||||
CppEditor::Constants::CPP_SETTINGS_ID);
|
||||
|
||||
// Apply changes
|
||||
std::unique_ptr<TextEditor::Indenter> indenter;
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
|
||||
#include <coreplugin/actionmanager/actionmanager.h>
|
||||
#include <coreplugin/find/itemviewfind.h>
|
||||
#include <cpptools/projectinfo.h>
|
||||
#include <cppeditor/projectinfo.h>
|
||||
#include <projectexplorer/selectablefilesmodel.h>
|
||||
#include <texteditor/textdocument.h>
|
||||
|
||||
@@ -41,7 +41,7 @@
|
||||
#include <QSortFilterProxyModel>
|
||||
#include <QStandardItem>
|
||||
|
||||
using namespace CppTools;
|
||||
using namespace CppEditor;
|
||||
using namespace Utils;
|
||||
using namespace ProjectExplorer;
|
||||
|
||||
|
||||
@@ -34,7 +34,7 @@ class QDialogButtonBox;
|
||||
class QPushButton;
|
||||
QT_END_NAMESPACE
|
||||
|
||||
namespace CppTools { class ProjectInfo; }
|
||||
namespace CppEditor { class ProjectInfo; }
|
||||
|
||||
namespace ClangTools {
|
||||
namespace Internal {
|
||||
|
||||
@@ -30,9 +30,9 @@
|
||||
|
||||
#include <coreplugin/icore.h>
|
||||
|
||||
#include <cpptools/clangdiagnosticconfigsmodel.h>
|
||||
#include <cpptools/compileroptionsbuilder.h>
|
||||
#include <cpptools/cpptoolsreuse.h>
|
||||
#include <cppeditor/clangdiagnosticconfigsmodel.h>
|
||||
#include <cppeditor/compileroptionsbuilder.h>
|
||||
#include <cppeditor/cpptoolsreuse.h>
|
||||
|
||||
#include <utils/qtcassert.h>
|
||||
#include <utils/qtcprocess.h>
|
||||
@@ -43,7 +43,7 @@
|
||||
|
||||
static Q_LOGGING_CATEGORY(LOG, "qtc.clangtools.runner", QtWarningMsg)
|
||||
|
||||
using namespace CppTools;
|
||||
using namespace CppEditor;
|
||||
|
||||
namespace ClangTools {
|
||||
namespace Internal {
|
||||
@@ -77,7 +77,7 @@ static QStringList clangArguments(const ClangDiagnosticConfig &diagnosticConfig,
|
||||
{
|
||||
QStringList arguments;
|
||||
arguments << ClangDiagnosticConfigsModel::globalDiagnosticOptions()
|
||||
<< (isClMode(baseOptions) ? CppTools::clangArgsForCl(diagnosticConfig.clangOptions())
|
||||
<< (isClMode(baseOptions) ? CppEditor::clangArgsForCl(diagnosticConfig.clangOptions())
|
||||
: diagnosticConfig.clangOptions())
|
||||
<< baseOptions;
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <cpptools/clangdiagnosticconfig.h>
|
||||
#include <cppeditor/clangdiagnosticconfig.h>
|
||||
|
||||
#include "clangtoolrunner.h"
|
||||
|
||||
@@ -37,7 +37,7 @@ class ClangTidyRunner final : public ClangToolRunner
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
ClangTidyRunner(const CppTools::ClangDiagnosticConfig &config, QObject *parent = nullptr);
|
||||
ClangTidyRunner(const CppEditor::ClangDiagnosticConfig &config, QObject *parent = nullptr);
|
||||
};
|
||||
|
||||
class ClazyStandaloneRunner final : public ClangToolRunner
|
||||
@@ -45,7 +45,7 @@ class ClazyStandaloneRunner final : public ClangToolRunner
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
ClazyStandaloneRunner(const CppTools::ClangDiagnosticConfig &config, QObject *parent = nullptr);
|
||||
ClazyStandaloneRunner(const CppEditor::ClangDiagnosticConfig &config, QObject *parent = nullptr);
|
||||
};
|
||||
|
||||
} // namespace Internal
|
||||
|
||||
@@ -46,8 +46,8 @@
|
||||
#include <coreplugin/icore.h>
|
||||
#include <coreplugin/messagebox.h>
|
||||
|
||||
#include <cpptools/clangdiagnosticconfigsmodel.h>
|
||||
#include <cpptools/cppmodelmanager.h>
|
||||
#include <cppeditor/clangdiagnosticconfigsmodel.h>
|
||||
#include <cppeditor/cppmodelmanager.h>
|
||||
|
||||
#include <debugger/analyzer/analyzermanager.h>
|
||||
|
||||
@@ -79,7 +79,7 @@
|
||||
#include <QToolButton>
|
||||
|
||||
using namespace Core;
|
||||
using namespace CppTools;
|
||||
using namespace CppEditor;
|
||||
using namespace Debugger;
|
||||
using namespace ProjectExplorer;
|
||||
using namespace Utils;
|
||||
@@ -325,22 +325,22 @@ private:
|
||||
QMap<Utils::FilePath, RefactoringFileInfo> m_refactoringFileInfos;
|
||||
};
|
||||
|
||||
static FileInfos sortedFileInfos(const QVector<CppTools::ProjectPart::ConstPtr> &projectParts)
|
||||
static FileInfos sortedFileInfos(const QVector<CppEditor::ProjectPart::ConstPtr> &projectParts)
|
||||
{
|
||||
FileInfos fileInfos;
|
||||
|
||||
for (const CppTools::ProjectPart::ConstPtr &projectPart : projectParts) {
|
||||
for (const CppEditor::ProjectPart::ConstPtr &projectPart : projectParts) {
|
||||
QTC_ASSERT(projectPart, continue);
|
||||
if (!projectPart->selectedForBuilding)
|
||||
continue;
|
||||
|
||||
for (const CppTools::ProjectFile &file : qAsConst(projectPart->files)) {
|
||||
QTC_ASSERT(file.kind != CppTools::ProjectFile::Unclassified, continue);
|
||||
QTC_ASSERT(file.kind != CppTools::ProjectFile::Unsupported, continue);
|
||||
if (file.path == CppTools::CppModelManager::configurationFileName())
|
||||
for (const CppEditor::ProjectFile &file : qAsConst(projectPart->files)) {
|
||||
QTC_ASSERT(file.kind != CppEditor::ProjectFile::Unclassified, continue);
|
||||
QTC_ASSERT(file.kind != CppEditor::ProjectFile::Unsupported, continue);
|
||||
if (file.path == CppEditor::CppModelManager::configurationFileName())
|
||||
continue;
|
||||
|
||||
if (file.active && CppTools::ProjectFile::isSource(file.kind)) {
|
||||
if (file.active && CppEditor::ProjectFile::isSource(file.kind)) {
|
||||
fileInfos.emplace_back(Utils::FilePath::fromString(file.path),
|
||||
file.kind,
|
||||
projectPart);
|
||||
@@ -638,7 +638,7 @@ static bool continueDespiteReleaseBuild(const QString &toolName)
|
||||
|
||||
void ClangTool::startTool(ClangTool::FileSelection fileSelection,
|
||||
const RunSettings &runSettings,
|
||||
const CppTools::ClangDiagnosticConfig &diagnosticConfig)
|
||||
const CppEditor::ClangDiagnosticConfig &diagnosticConfig)
|
||||
{
|
||||
Project *project = SessionManager::startupProject();
|
||||
QTC_ASSERT(project, return);
|
||||
@@ -736,7 +736,7 @@ FileInfos ClangTool::collectFileInfos(Project *project, FileSelection fileSelect
|
||||
return {};
|
||||
}
|
||||
|
||||
const auto projectInfo = CppTools::CppModelManager::instance()->projectInfo(project);
|
||||
const auto projectInfo = CppEditor::CppModelManager::instance()->projectInfo(project);
|
||||
QTC_ASSERT(projectInfo, return FileInfos());
|
||||
|
||||
const FileInfos allFileInfos = sortedFileInfos(projectInfo->projectParts());
|
||||
@@ -1116,7 +1116,7 @@ void ClangTool::setState(ClangTool::State state)
|
||||
QSet<Diagnostic> ClangTool::diagnostics() const
|
||||
{
|
||||
return Utils::filtered(m_diagnosticModel->diagnostics(), [](const Diagnostic &diagnostic) {
|
||||
using CppTools::ProjectFile;
|
||||
using CppEditor::ProjectFile;
|
||||
return ProjectFile::isSource(ProjectFile::classify(diagnostic.location.filePath.toString()));
|
||||
});
|
||||
}
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
#include <debugger/debuggermainwindow.h>
|
||||
|
||||
#include <projectexplorer/runconfiguration.h>
|
||||
#include <cpptools/projectinfo.h>
|
||||
#include <cppeditor/projectinfo.h>
|
||||
|
||||
#include <utils/variant.h>
|
||||
|
||||
@@ -42,7 +42,7 @@ class QFrame;
|
||||
class QToolButton;
|
||||
QT_END_NAMESPACE
|
||||
|
||||
namespace CppTools {
|
||||
namespace CppEditor {
|
||||
class ClangDiagnosticConfig;
|
||||
}
|
||||
namespace Debugger {
|
||||
@@ -92,7 +92,7 @@ public:
|
||||
void startTool(FileSelection fileSelection);
|
||||
void startTool(FileSelection fileSelection,
|
||||
const RunSettings &runSettings,
|
||||
const CppTools::ClangDiagnosticConfig &diagnosticConfig);
|
||||
const CppEditor::ClangDiagnosticConfig &diagnosticConfig);
|
||||
|
||||
Diagnostics read(OutputFileFormat outputFileFormat,
|
||||
const QString &logFilePath,
|
||||
|
||||
@@ -41,12 +41,12 @@
|
||||
#include <coreplugin/progressmanager/futureprogress.h>
|
||||
#include <coreplugin/progressmanager/progressmanager.h>
|
||||
|
||||
#include <cpptools/clangdiagnosticconfigsmodel.h>
|
||||
#include <cpptools/compileroptionsbuilder.h>
|
||||
#include <cpptools/cppmodelmanager.h>
|
||||
#include <cpptools/cppprojectfile.h>
|
||||
#include <cpptools/cpptoolsreuse.h>
|
||||
#include <cpptools/projectinfo.h>
|
||||
#include <cppeditor/clangdiagnosticconfigsmodel.h>
|
||||
#include <cppeditor/compileroptionsbuilder.h>
|
||||
#include <cppeditor/cppmodelmanager.h>
|
||||
#include <cppeditor/cppprojectfile.h>
|
||||
#include <cppeditor/cpptoolsreuse.h>
|
||||
#include <cppeditor/projectinfo.h>
|
||||
|
||||
#include <projectexplorer/abi.h>
|
||||
#include <projectexplorer/buildconfiguration.h>
|
||||
@@ -67,7 +67,7 @@
|
||||
#include <QAction>
|
||||
#include <QLoggingCategory>
|
||||
|
||||
using namespace CppTools;
|
||||
using namespace CppEditor;
|
||||
using namespace ProjectExplorer;
|
||||
using namespace Utils;
|
||||
|
||||
@@ -128,7 +128,7 @@ AnalyzeUnit::AnalyzeUnit(const FileInfo &fileInfo,
|
||||
clangIncludeDir);
|
||||
file = fileInfo.file.toString();
|
||||
arguments = extraClangToolsPrependOptions();
|
||||
arguments.append(optionsBuilder.build(fileInfo.kind, CppTools::getPchUsage()));
|
||||
arguments.append(optionsBuilder.build(fileInfo.kind, CppEditor::getPchUsage()));
|
||||
arguments.append(extraClangToolsAppendOptions());
|
||||
}
|
||||
|
||||
@@ -160,7 +160,7 @@ static QDebug operator<<(QDebug debug, const AnalyzeUnits &analyzeUnits)
|
||||
|
||||
ClangToolRunWorker::ClangToolRunWorker(RunControl *runControl,
|
||||
const RunSettings &runSettings,
|
||||
const CppTools::ClangDiagnosticConfig &diagnosticConfig,
|
||||
const CppEditor::ClangDiagnosticConfig &diagnosticConfig,
|
||||
const FileInfos &fileInfos,
|
||||
bool buildBeforeAnalysis)
|
||||
: RunWorker(runControl)
|
||||
@@ -179,7 +179,7 @@ ClangToolRunWorker::ClangToolRunWorker(RunControl *runControl,
|
||||
}
|
||||
|
||||
Target *target = runControl->target();
|
||||
m_projectInfoBeforeBuild = CppTools::CppModelManager::instance()->projectInfo(target->project());
|
||||
m_projectInfoBeforeBuild = CppEditor::CppModelManager::instance()->projectInfo(target->project());
|
||||
|
||||
BuildConfiguration *buildConfiguration = target->activeBuildConfiguration();
|
||||
QTC_ASSERT(buildConfiguration, return);
|
||||
@@ -216,7 +216,7 @@ void ClangToolRunWorker::start()
|
||||
|
||||
const QString &toolName = tool()->name();
|
||||
Project *project = runControl()->project();
|
||||
m_projectInfo = CppTools::CppModelManager::instance()->projectInfo(project);
|
||||
m_projectInfo = CppEditor::CppModelManager::instance()->projectInfo(project);
|
||||
if (!m_projectInfo) {
|
||||
reportFailure(tr("No code model data available for project."));
|
||||
return;
|
||||
|
||||
@@ -28,8 +28,8 @@
|
||||
#include "clangfileinfo.h"
|
||||
#include "clangtoolssettings.h"
|
||||
|
||||
#include <cpptools/clangdiagnosticconfig.h>
|
||||
#include <cpptools/projectinfo.h>
|
||||
#include <cppeditor/clangdiagnosticconfig.h>
|
||||
#include <cppeditor/projectinfo.h>
|
||||
#include <projectexplorer/runcontrol.h>
|
||||
#include <utils/environment.h>
|
||||
#include <utils/temporarydirectory.h>
|
||||
@@ -70,7 +70,7 @@ class ClangToolRunWorker : public ProjectExplorer::RunWorker
|
||||
public:
|
||||
ClangToolRunWorker(ProjectExplorer::RunControl *runControl,
|
||||
const RunSettings &runSettings,
|
||||
const CppTools::ClangDiagnosticConfig &diagnosticConfig,
|
||||
const CppEditor::ClangDiagnosticConfig &diagnosticConfig,
|
||||
const FileInfos &fileInfos,
|
||||
bool buildBeforeAnalysis);
|
||||
|
||||
@@ -107,15 +107,15 @@ private:
|
||||
|
||||
private:
|
||||
RunSettings m_runSettings;
|
||||
CppTools::ClangDiagnosticConfig m_diagnosticConfig;
|
||||
CppEditor::ClangDiagnosticConfig m_diagnosticConfig;
|
||||
FileInfos m_fileInfos;
|
||||
|
||||
ProjectBuilder *m_projectBuilder = nullptr;
|
||||
Utils::Environment m_environment;
|
||||
Utils::TemporaryDirectory m_temporaryDir;
|
||||
|
||||
CppTools::ProjectInfo::ConstPtr m_projectInfoBeforeBuild;
|
||||
CppTools::ProjectInfo::ConstPtr m_projectInfo;
|
||||
CppEditor::ProjectInfo::ConstPtr m_projectInfoBeforeBuild;
|
||||
CppEditor::ProjectInfo::ConstPtr m_projectInfo;
|
||||
QString m_targetTriple;
|
||||
Utils::Id m_toolChainType;
|
||||
|
||||
|
||||
@@ -4,14 +4,13 @@ import qbs.FileInfo
|
||||
QtcPlugin {
|
||||
name: "ClangTools"
|
||||
|
||||
Depends { name: "Debugger" }
|
||||
Depends { name: "Core" }
|
||||
Depends { name: "TextEditor" }
|
||||
Depends { name: "CppTools" }
|
||||
Depends { name: "CppEditor" }
|
||||
Depends { name: "Debugger" }
|
||||
Depends { name: "ProjectExplorer" }
|
||||
Depends { name: "QtSupport"; condition: qtc.testsEnabled }
|
||||
Depends { name: "QtcSsh" }
|
||||
Depends { name: "TextEditor" }
|
||||
Depends { name: "Utils" }
|
||||
|
||||
Depends { name: "yaml-cpp" }
|
||||
@@ -19,10 +18,6 @@ QtcPlugin {
|
||||
|
||||
Depends { name: "Qt.widgets" }
|
||||
|
||||
pluginRecommends: [
|
||||
"CppEditor"
|
||||
]
|
||||
|
||||
pluginTestDepends: [
|
||||
"QbsProjectManager",
|
||||
"QmakeProjectManager",
|
||||
|
||||
@@ -8,9 +8,6 @@ isEmpty(EXTERNAL_YAML_CPP_FOUND): QTC_LIB_DEPENDS += yaml-cpp
|
||||
|
||||
QTC_PLUGIN_DEPENDS += \
|
||||
debugger \
|
||||
cppeditor \
|
||||
cpptools
|
||||
QTC_PLUGIN_RECOMMENDS += \
|
||||
cppeditor
|
||||
QTC_TEST_DEPENDS += \
|
||||
qbsprojectmanager \
|
||||
|
||||
@@ -51,7 +51,7 @@
|
||||
|
||||
#include <set>
|
||||
|
||||
using namespace CppTools;
|
||||
using namespace CppEditor;
|
||||
using namespace Debugger;
|
||||
|
||||
namespace ClangTools {
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
|
||||
#include "clangtoolslogfilereader.h"
|
||||
|
||||
#include <cpptools/cppprojectfile.h>
|
||||
#include <cppeditor/cppprojectfile.h>
|
||||
|
||||
#include <QDir>
|
||||
#include <QFileInfo>
|
||||
|
||||
@@ -50,13 +50,11 @@
|
||||
#include <coreplugin/icontext.h>
|
||||
#include <coreplugin/icore.h>
|
||||
|
||||
#include <cpptools/cpptoolsconstants.h>
|
||||
#include <cpptools/cppmodelmanager.h>
|
||||
#include <cppeditor/cppeditorconstants.h>
|
||||
#include <cppeditor/cppmodelmanager.h>
|
||||
|
||||
#include <texteditor/texteditor.h>
|
||||
|
||||
#include <cppeditor/cppeditorconstants.h>
|
||||
|
||||
#include <projectexplorer/kitinformation.h>
|
||||
#include <projectexplorer/projectpanelfactory.h>
|
||||
#include <projectexplorer/target.h>
|
||||
@@ -117,7 +115,7 @@ bool ClangToolsPlugin::initialize(const QStringList &arguments, QString *errorSt
|
||||
|
||||
TaskHub::addCategory(taskCategory(), tr("Clang Tools"));
|
||||
|
||||
// Import tidy/clazy diagnostic configs from CppTools now
|
||||
// Import tidy/clazy diagnostic configs from CppEditor now
|
||||
// instead of at opening time of the settings page
|
||||
ClangToolsSettings::instance();
|
||||
|
||||
@@ -159,7 +157,7 @@ void ClangToolsPlugin::registerAnalyzeActions()
|
||||
ActionManager::registerAction(d->clangTool.startAction(), Constants::RUN_ON_PROJECT);
|
||||
Command *cmd = ActionManager::registerAction(d->clangTool.startOnCurrentFileAction(),
|
||||
Constants::RUN_ON_CURRENT_FILE);
|
||||
ActionContainer *mtoolscpp = ActionManager::actionContainer(CppTools::Constants::M_TOOLS_CPP);
|
||||
ActionContainer *mtoolscpp = ActionManager::actionContainer(CppEditor::Constants::M_TOOLS_CPP);
|
||||
if (mtoolscpp)
|
||||
mtoolscpp->addAction(cmd);
|
||||
|
||||
|
||||
@@ -30,8 +30,8 @@
|
||||
#include "clangtoolsutils.h"
|
||||
|
||||
#include <coreplugin/icore.h>
|
||||
#include <cpptools/compileroptionsbuilder.h>
|
||||
#include <cpptools/projectinfo.h>
|
||||
#include <cppeditor/compileroptionsbuilder.h>
|
||||
#include <cppeditor/projectinfo.h>
|
||||
#include <projectexplorer/kitinformation.h>
|
||||
#include <projectexplorer/kitmanager.h>
|
||||
#include <projectexplorer/project.h>
|
||||
@@ -49,7 +49,7 @@
|
||||
|
||||
#include <functional>
|
||||
|
||||
using namespace CppTools;
|
||||
using namespace CppEditor;
|
||||
using namespace ProjectExplorer;
|
||||
|
||||
static bool processEventsUntil(const std::function<bool()> condition, int timeOutInMs = 30000)
|
||||
|
||||
@@ -33,13 +33,13 @@
|
||||
#include "clangtoolsutils.h"
|
||||
|
||||
#include <coreplugin/icore.h>
|
||||
#include <cpptools/clangdiagnosticconfigsselectionwidget.h>
|
||||
#include <cppeditor/clangdiagnosticconfigsselectionwidget.h>
|
||||
|
||||
#include <utils/qtcassert.h>
|
||||
|
||||
#include <QAbstractTableModel>
|
||||
|
||||
#include <cpptools/clangdiagnosticconfigsmodel.h>
|
||||
#include <cppeditor/clangdiagnosticconfigsmodel.h>
|
||||
|
||||
namespace ClangTools {
|
||||
namespace Internal {
|
||||
@@ -108,7 +108,7 @@ ProjectSettingsWidget::ProjectSettingsWidget(ProjectExplorer::Project *project,
|
||||
m_projectSettings->setRunSettings(m_ui->runSettingsWidget->toSettings());
|
||||
|
||||
// Save global custom configs
|
||||
const CppTools::ClangDiagnosticConfigs configs
|
||||
const CppEditor::ClangDiagnosticConfigs configs
|
||||
= m_ui->runSettingsWidget->diagnosticSelectionWidget()->customConfigs();
|
||||
ClangToolsSettings::instance()->setDiagnosticConfigs(configs);
|
||||
ClangToolsSettings::instance()->writeSettings();
|
||||
|
||||
@@ -29,15 +29,15 @@
|
||||
#include "clangtoolsutils.h"
|
||||
|
||||
#include <coreplugin/icore.h>
|
||||
#include <cpptools/clangdiagnosticconfig.h>
|
||||
#include <cpptools/cppcodemodelsettings.h>
|
||||
#include <cpptools/cpptoolsreuse.h>
|
||||
#include <cppeditor/clangdiagnosticconfig.h>
|
||||
#include <cppeditor/cppcodemodelsettings.h>
|
||||
#include <cppeditor/cpptoolsreuse.h>
|
||||
|
||||
#include <utils/algorithm.h>
|
||||
|
||||
#include <QThread>
|
||||
|
||||
using namespace CppTools;
|
||||
using namespace CppEditor;
|
||||
using namespace Utils;
|
||||
|
||||
namespace ClangTools {
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
|
||||
#include "executableinfo.h"
|
||||
|
||||
#include <cpptools/clangdiagnosticconfig.h>
|
||||
#include <cppeditor/clangdiagnosticconfig.h>
|
||||
|
||||
#include <utils/id.h>
|
||||
|
||||
@@ -83,8 +83,8 @@ public:
|
||||
Utils::FilePath clazyStandaloneExecutable() const { return m_clazyStandaloneExecutable; }
|
||||
void setClazyStandaloneExecutable(const Utils::FilePath &path);
|
||||
|
||||
CppTools::ClangDiagnosticConfigs diagnosticConfigs() const { return m_diagnosticConfigs; }
|
||||
void setDiagnosticConfigs(const CppTools::ClangDiagnosticConfigs &configs)
|
||||
CppEditor::ClangDiagnosticConfigs diagnosticConfigs() const { return m_diagnosticConfigs; }
|
||||
void setDiagnosticConfigs(const CppEditor::ClangDiagnosticConfigs &configs)
|
||||
{ m_diagnosticConfigs = configs; }
|
||||
|
||||
RunSettings runSettings() const { return m_runSettings; }
|
||||
@@ -105,7 +105,7 @@ private:
|
||||
Utils::FilePath m_clazyStandaloneExecutable;
|
||||
|
||||
// Diagnostic Configs
|
||||
CppTools::ClangDiagnosticConfigs m_diagnosticConfigs;
|
||||
CppEditor::ClangDiagnosticConfigs m_diagnosticConfigs;
|
||||
|
||||
// Run settings
|
||||
RunSettings m_runSettings;
|
||||
|
||||
@@ -31,10 +31,10 @@
|
||||
#include "clangtoolsutils.h"
|
||||
|
||||
#include <coreplugin/icore.h>
|
||||
#include <cpptools/clangdiagnosticconfig.h>
|
||||
#include <cpptools/cppmodelmanager.h>
|
||||
#include <cpptools/cpptoolsreuse.h>
|
||||
#include <cpptools/cpptoolstestcase.h>
|
||||
#include <cppeditor/clangdiagnosticconfig.h>
|
||||
#include <cppeditor/cppmodelmanager.h>
|
||||
#include <cppeditor/cpptoolsreuse.h>
|
||||
#include <cppeditor/cpptoolstestcase.h>
|
||||
#include <projectexplorer/kitinformation.h>
|
||||
#include <projectexplorer/kitmanager.h>
|
||||
#include <projectexplorer/projectexplorer.h>
|
||||
@@ -50,11 +50,11 @@
|
||||
#include <QTimer>
|
||||
#include <QtTest>
|
||||
|
||||
using namespace CppTools;
|
||||
using namespace CppEditor;
|
||||
using namespace ProjectExplorer;
|
||||
using namespace Utils;
|
||||
|
||||
Q_DECLARE_METATYPE(CppTools::ClangDiagnosticConfig)
|
||||
Q_DECLARE_METATYPE(CppEditor::ClangDiagnosticConfig)
|
||||
|
||||
namespace ClangTools {
|
||||
namespace Internal {
|
||||
|
||||
@@ -27,10 +27,10 @@
|
||||
|
||||
#include <QObject>
|
||||
|
||||
namespace CppTools {
|
||||
namespace CppEditor {
|
||||
class ClangDiagnosticConfig;
|
||||
namespace Tests { class TemporaryCopiedDir; }
|
||||
} // namespace CppTools
|
||||
} // namespace CppEditor
|
||||
|
||||
namespace ProjectExplorer { class Kit; }
|
||||
|
||||
@@ -53,12 +53,12 @@ private slots:
|
||||
private:
|
||||
void addTestRow(const QByteArray &relativeFilePath,
|
||||
int expectedDiagCount,
|
||||
const CppTools::ClangDiagnosticConfig &diagnosticConfig);
|
||||
const CppEditor::ClangDiagnosticConfig &diagnosticConfig);
|
||||
|
||||
private:
|
||||
static int getTimeout();
|
||||
|
||||
CppTools::Tests::TemporaryCopiedDir *m_tmpDir = nullptr;
|
||||
CppEditor::Tests::TemporaryCopiedDir *m_tmpDir = nullptr;
|
||||
ProjectExplorer::Kit *m_kit = nullptr;
|
||||
int m_timeout = getTimeout();
|
||||
};
|
||||
|
||||
@@ -31,8 +31,8 @@
|
||||
#include "clangtoolssettings.h"
|
||||
|
||||
#include <coreplugin/icore.h>
|
||||
#include <cpptools/cpptoolsconstants.h>
|
||||
#include <cpptools/cpptoolsreuse.h>
|
||||
#include <cppeditor/cppeditorconstants.h>
|
||||
#include <cppeditor/cpptoolsreuse.h>
|
||||
#include <projectexplorer/projectexplorerconstants.h>
|
||||
|
||||
#include <utils/checkablemessagebox.h>
|
||||
@@ -41,9 +41,9 @@
|
||||
#include <utils/hostosinfo.h>
|
||||
#include <utils/qtcprocess.h>
|
||||
|
||||
#include <cpptools/clangdiagnosticconfigsmodel.h>
|
||||
#include <cppeditor/clangdiagnosticconfigsmodel.h>
|
||||
|
||||
using namespace CppTools;
|
||||
using namespace CppEditor;
|
||||
using namespace Utils;
|
||||
|
||||
namespace ClangTools {
|
||||
@@ -293,7 +293,7 @@ QString documentationUrl(const QString &checkName)
|
||||
name = checkName.mid(clazyPrefix.length());
|
||||
url = clazyDocUrl(name);
|
||||
} else if (name.startsWith(clangStaticAnalyzerPrefix)) {
|
||||
url = CppTools::Constants::CLANG_STATIC_ANALYZER_DOCUMENTATION_URL;
|
||||
url = CppEditor::Constants::CLANG_STATIC_ANALYZER_DOCUMENTATION_URL;
|
||||
} else {
|
||||
url = clangTidyDocUrl(name);
|
||||
}
|
||||
|
||||
@@ -25,14 +25,14 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <cpptools/clangdiagnosticconfig.h>
|
||||
#include <cppeditor/clangdiagnosticconfig.h>
|
||||
|
||||
#include <utils/id.h>
|
||||
#include <utils/optional.h>
|
||||
|
||||
#include <QtGlobal>
|
||||
|
||||
namespace CppTools { class ClangDiagnosticConfigsModel; }
|
||||
namespace CppEditor { class ClangDiagnosticConfigsModel; }
|
||||
namespace Debugger { class DiagnosticLocation; }
|
||||
namespace Utils { class FilePath; }
|
||||
|
||||
@@ -58,7 +58,7 @@ QString createDiagnosticToolTipString(
|
||||
Utils::optional<FixitStatus> status = Utils::nullopt,
|
||||
bool showSteps = true);
|
||||
|
||||
CppTools::ClangDiagnosticConfig builtinConfig();
|
||||
CppEditor::ClangDiagnosticConfig builtinConfig();
|
||||
|
||||
QString createFullLocationString(const Debugger::DiagnosticLocation &location);
|
||||
|
||||
@@ -77,11 +77,11 @@ Utils::FilePath fullPath(const Utils::FilePath &executable);
|
||||
|
||||
QString documentationUrl(const QString &checkName);
|
||||
|
||||
CppTools::ClangDiagnosticConfigsModel diagnosticConfigsModel();
|
||||
CppTools::ClangDiagnosticConfigsModel diagnosticConfigsModel(
|
||||
const CppTools::ClangDiagnosticConfigs &customConfigs);
|
||||
CppEditor::ClangDiagnosticConfigsModel diagnosticConfigsModel();
|
||||
CppEditor::ClangDiagnosticConfigsModel diagnosticConfigsModel(
|
||||
const CppEditor::ClangDiagnosticConfigs &customConfigs);
|
||||
|
||||
CppTools::ClangDiagnosticConfig diagnosticConfig(const Utils::Id &diagConfigId);
|
||||
CppEditor::ClangDiagnosticConfig diagnosticConfig(const Utils::Id &diagConfigId);
|
||||
|
||||
QStringList extraClangToolsPrependOptions();
|
||||
QStringList extraClangToolsAppendOptions();
|
||||
|
||||
@@ -34,9 +34,9 @@
|
||||
#include "ui_clazychecks.h"
|
||||
#include "ui_tidychecks.h"
|
||||
|
||||
#include <cpptools/cppcodemodelsettings.h>
|
||||
#include <cpptools/cpptoolsconstants.h>
|
||||
#include <cpptools/cpptoolsreuse.h>
|
||||
#include <cppeditor/cppcodemodelsettings.h>
|
||||
#include <cppeditor/cppeditorconstants.h>
|
||||
#include <cppeditor/cpptoolsreuse.h>
|
||||
#include <projectexplorer/selectablefilesmodel.h>
|
||||
#include <projectexplorer/session.h>
|
||||
|
||||
@@ -57,7 +57,7 @@
|
||||
#include <QUuid>
|
||||
#include <QVBoxLayout>
|
||||
|
||||
using namespace CppTools;
|
||||
using namespace CppEditor;
|
||||
|
||||
namespace ClangTools {
|
||||
namespace Internal {
|
||||
@@ -448,7 +448,7 @@ public:
|
||||
if (role == LinkRole || role == Qt::ToolTipRole) {
|
||||
// 'clang-analyzer-' group
|
||||
if (node->isDir)
|
||||
return CppTools::Constants::CLANG_STATIC_ANALYZER_DOCUMENTATION_URL;
|
||||
return CppEditor::Constants::CLANG_STATIC_ANALYZER_DOCUMENTATION_URL;
|
||||
return clangTidyDocUrl(node->fullPath.toString());
|
||||
}
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
|
||||
#include "executableinfo.h"
|
||||
|
||||
#include <cpptools/clangdiagnosticconfigswidget.h>
|
||||
#include <cppeditor/clangdiagnosticconfigswidget.h>
|
||||
|
||||
#include <memory>
|
||||
|
||||
@@ -49,25 +49,25 @@ class TidyChecksTreeModel;
|
||||
class ClazyChecksTreeModel;
|
||||
class ClazyChecksSortFilterModel;
|
||||
|
||||
// Like CppTools::ClangDiagnosticConfigsWidget, but with tabs/widgets for clang-tidy and clazy
|
||||
class DiagnosticConfigsWidget : public CppTools::ClangDiagnosticConfigsWidget
|
||||
// Like CppEditor::ClangDiagnosticConfigsWidget, but with tabs/widgets for clang-tidy and clazy
|
||||
class DiagnosticConfigsWidget : public CppEditor::ClangDiagnosticConfigsWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
DiagnosticConfigsWidget(const CppTools::ClangDiagnosticConfigs &configs,
|
||||
DiagnosticConfigsWidget(const CppEditor::ClangDiagnosticConfigs &configs,
|
||||
const Utils::Id &configToSelect,
|
||||
const ClangTidyInfo &tidyInfo,
|
||||
const ClazyStandaloneInfo &clazyInfo);
|
||||
~DiagnosticConfigsWidget();
|
||||
|
||||
private:
|
||||
void syncExtraWidgets(const CppTools::ClangDiagnosticConfig &config) override;
|
||||
void syncExtraWidgets(const CppEditor::ClangDiagnosticConfig &config) override;
|
||||
|
||||
void syncClangTidyWidgets(const CppTools::ClangDiagnosticConfig &config);
|
||||
void syncTidyChecksToTree(const CppTools::ClangDiagnosticConfig &config);
|
||||
void syncClangTidyWidgets(const CppEditor::ClangDiagnosticConfig &config);
|
||||
void syncTidyChecksToTree(const CppEditor::ClangDiagnosticConfig &config);
|
||||
|
||||
void syncClazyWidgets(const CppTools::ClangDiagnosticConfig &config);
|
||||
void syncClazyWidgets(const CppEditor::ClangDiagnosticConfig &config);
|
||||
void syncClazyChecksGroupBox();
|
||||
|
||||
void onClangTidyModeChanged(int index);
|
||||
|
||||
@@ -39,7 +39,7 @@
|
||||
#include <coreplugin/documentmanager.h>
|
||||
#include <coreplugin/editormanager/editormanager.h>
|
||||
#include <coreplugin/editormanager/ieditor.h>
|
||||
#include <cpptools/cppmodelmanager.h>
|
||||
#include <cppeditor/cppmodelmanager.h>
|
||||
#include <projectexplorer/buildtargettype.h>
|
||||
#include <projectexplorer/session.h>
|
||||
#include <projectexplorer/target.h>
|
||||
@@ -54,7 +54,7 @@
|
||||
static Q_LOGGING_CATEGORY(LOG, "qtc.clangtools.cftr", QtWarningMsg)
|
||||
|
||||
using namespace Core;
|
||||
using namespace CppTools;
|
||||
using namespace CppEditor;
|
||||
using namespace ProjectExplorer;
|
||||
using namespace Utils;
|
||||
|
||||
|
||||
@@ -36,7 +36,7 @@
|
||||
#include <QTimer>
|
||||
|
||||
namespace Core { class IDocument; }
|
||||
namespace CppTools { class ClangDiagnosticConfig; }
|
||||
namespace CppEditor { class ClangDiagnosticConfig; }
|
||||
namespace TextEditor { class TextEditorWidget; }
|
||||
|
||||
namespace ClangTools {
|
||||
@@ -70,9 +70,9 @@ private:
|
||||
|
||||
bool isSuppressed(const Diagnostic &diagnostic) const;
|
||||
|
||||
const CppTools::ClangDiagnosticConfig getDiagnosticConfig(ProjectExplorer::Project *project);
|
||||
const CppEditor::ClangDiagnosticConfig getDiagnosticConfig(ProjectExplorer::Project *project);
|
||||
template<class T>
|
||||
ClangToolRunner *createRunner(const CppTools::ClangDiagnosticConfig &config,
|
||||
ClangToolRunner *createRunner(const CppEditor::ClangDiagnosticConfig &config,
|
||||
const Utils::Environment &env);
|
||||
|
||||
QTimer m_runTimer;
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
#include "executableinfo.h"
|
||||
#include "settingswidget.h"
|
||||
|
||||
#include <cpptools/clangdiagnosticconfigswidget.h>
|
||||
#include <cppeditor/clangdiagnosticconfigswidget.h>
|
||||
|
||||
#include <QThread>
|
||||
|
||||
@@ -53,13 +53,13 @@ RunSettingsWidget::~RunSettingsWidget()
|
||||
delete m_ui;
|
||||
}
|
||||
|
||||
CppTools::ClangDiagnosticConfigsSelectionWidget *RunSettingsWidget::diagnosticSelectionWidget()
|
||||
CppEditor::ClangDiagnosticConfigsSelectionWidget *RunSettingsWidget::diagnosticSelectionWidget()
|
||||
{
|
||||
return m_ui->diagnosticWidget;
|
||||
}
|
||||
|
||||
static CppTools::ClangDiagnosticConfigsWidget *createEditWidget(
|
||||
const CppTools::ClangDiagnosticConfigs &configs, const Utils::Id &configToSelect)
|
||||
static CppEditor::ClangDiagnosticConfigsWidget *createEditWidget(
|
||||
const CppEditor::ClangDiagnosticConfigs &configs, const Utils::Id &configToSelect)
|
||||
{
|
||||
// Determine executable paths
|
||||
FilePath clangTidyPath;
|
||||
@@ -92,7 +92,7 @@ void RunSettingsWidget::fromSettings(const RunSettings &s)
|
||||
s.diagnosticConfigId(),
|
||||
createEditWidget);
|
||||
connect(m_ui->diagnosticWidget,
|
||||
&CppTools::ClangDiagnosticConfigsSelectionWidget::changed,
|
||||
&CppEditor::ClangDiagnosticConfigsSelectionWidget::changed,
|
||||
this,
|
||||
&RunSettingsWidget::changed);
|
||||
|
||||
|
||||
@@ -25,11 +25,11 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <cpptools/clangdiagnosticconfig.h>
|
||||
#include <cppeditor/clangdiagnosticconfig.h>
|
||||
|
||||
#include <QWidget>
|
||||
|
||||
namespace CppTools {
|
||||
namespace CppEditor {
|
||||
class ClangDiagnosticConfigsSelectionWidget;
|
||||
}
|
||||
|
||||
@@ -50,7 +50,7 @@ public:
|
||||
explicit RunSettingsWidget(QWidget *parent = nullptr);
|
||||
~RunSettingsWidget();
|
||||
|
||||
CppTools::ClangDiagnosticConfigsSelectionWidget *diagnosticSelectionWidget();
|
||||
CppEditor::ClangDiagnosticConfigsSelectionWidget *diagnosticSelectionWidget();
|
||||
|
||||
void fromSettings(const RunSettings &s);
|
||||
RunSettings toSettings() const;
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_2">
|
||||
<item>
|
||||
<widget class="CppTools::ClangDiagnosticConfigsSelectionWidget" name="diagnosticWidget" native="true"/>
|
||||
<widget class="CppEditor::ClangDiagnosticConfigsSelectionWidget" name="diagnosticWidget" native="true"/>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="buildBeforeAnalysis">
|
||||
@@ -87,9 +87,9 @@
|
||||
</widget>
|
||||
<customwidgets>
|
||||
<customwidget>
|
||||
<class>CppTools::ClangDiagnosticConfigsSelectionWidget</class>
|
||||
<class>CppEditor::ClangDiagnosticConfigsSelectionWidget</class>
|
||||
<extends>QWidget</extends>
|
||||
<header>cpptools/clangdiagnosticconfigsselectionwidget.h</header>
|
||||
<header>cppeditor/clangdiagnosticconfigsselectionwidget.h</header>
|
||||
</customwidget>
|
||||
</customwidgets>
|
||||
<resources/>
|
||||
|
||||
@@ -30,8 +30,8 @@
|
||||
#include "clangtoolsconstants.h"
|
||||
#include "clangtoolsutils.h"
|
||||
|
||||
#include <cpptools/clangdiagnosticconfigsmodel.h>
|
||||
#include <cpptools/clangdiagnosticconfigsselectionwidget.h>
|
||||
#include <cppeditor/clangdiagnosticconfigsmodel.h>
|
||||
#include <cppeditor/clangdiagnosticconfigsselectionwidget.h>
|
||||
|
||||
#include <debugger/analyzer/analyzericons.h>
|
||||
|
||||
@@ -110,7 +110,7 @@ void SettingsWidget::apply()
|
||||
m_settings->setRunSettings(m_ui->runSettingsWidget->toSettings());
|
||||
|
||||
// Custom configs
|
||||
const CppTools::ClangDiagnosticConfigs customConfigs
|
||||
const CppEditor::ClangDiagnosticConfigs customConfigs
|
||||
= m_ui->runSettingsWidget->diagnosticSelectionWidget()->customConfigs();
|
||||
m_settings->setDiagnosticConfigs(customConfigs);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user