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:
@@ -69,4 +69,4 @@ private:
|
||||
QList<AST *> _nodes;
|
||||
};
|
||||
|
||||
} // namespace CppTools
|
||||
} // namespace CPlusPlus
|
||||
|
@@ -21,7 +21,7 @@ add_subdirectory(silversearcher)
|
||||
|
||||
# Level 3: (only depends on Level 2 and below)
|
||||
add_subdirectory(bookmarks)
|
||||
add_subdirectory(cpptools)
|
||||
add_subdirectory(cppeditor)
|
||||
add_subdirectory(help)
|
||||
add_subdirectory(resourceeditor)
|
||||
add_subdirectory(tasklist)
|
||||
@@ -30,7 +30,6 @@ add_subdirectory(conan)
|
||||
|
||||
# Level 4: (only depends on Level 3 and below)
|
||||
add_subdirectory(classview)
|
||||
add_subdirectory(cppeditor)
|
||||
add_subdirectory(glsleditor)
|
||||
add_subdirectory(modeleditor)
|
||||
add_subdirectory(qtsupport)
|
||||
|
@@ -1,5 +1,5 @@
|
||||
add_qtc_plugin(AutoTest
|
||||
PLUGIN_DEPENDS Core CppTools Debugger ProjectExplorer QmlJSTools TextEditor
|
||||
PLUGIN_DEPENDS Core CppEditor Debugger ProjectExplorer QmlJSTools TextEditor
|
||||
PLUGIN_TEST_DEPENDS QmakeProjectManager QtSupport QbsProjectManager
|
||||
SOURCES
|
||||
autotest.qrc
|
||||
|
@@ -4,7 +4,7 @@ QtcPlugin {
|
||||
name: "AutoTest"
|
||||
|
||||
Depends { name: "Core" }
|
||||
Depends { name: "CppTools" }
|
||||
Depends { name: "CppEditor" }
|
||||
Depends { name: "CPlusPlus" }
|
||||
Depends { name: "ProjectExplorer" }
|
||||
Depends { name: "QmlJS" }
|
||||
|
@@ -3,7 +3,7 @@ QTC_PLUGIN_NAME = AutoTest
|
||||
QTC_PLUGIN_DEPENDS += \
|
||||
coreplugin \
|
||||
projectexplorer \
|
||||
cpptools \
|
||||
cppeditor \
|
||||
qmljstools \
|
||||
debugger \
|
||||
texteditor
|
||||
|
@@ -30,9 +30,9 @@
|
||||
#include "testsettings.h"
|
||||
#include "testtreemodel.h"
|
||||
|
||||
#include <cpptools/cppmodelmanager.h>
|
||||
#include <cpptools/cpptoolstestcase.h>
|
||||
#include <cpptools/projectinfo.h>
|
||||
#include <cppeditor/cppmodelmanager.h>
|
||||
#include <cppeditor/cpptoolstestcase.h>
|
||||
#include <cppeditor/projectinfo.h>
|
||||
|
||||
#include <extensionsystem/pluginmanager.h>
|
||||
|
||||
@@ -81,7 +81,7 @@ void AutoTestUnitTests::initTestCase()
|
||||
if (!toolchain)
|
||||
QSKIP("This test requires that there is a kit with a toolchain.");
|
||||
|
||||
m_tmpDir = new CppTools::Tests::TemporaryCopiedDir(":/unit_test");
|
||||
m_tmpDir = new CppEditor::Tests::TemporaryCopiedDir(":/unit_test");
|
||||
|
||||
if (!qEnvironmentVariableIsEmpty("BOOST_INCLUDE_DIR")) {
|
||||
m_checkBoost = true;
|
||||
@@ -108,7 +108,7 @@ void AutoTestUnitTests::testCodeParser()
|
||||
QFETCH(int, expectedUnnamedQuickTestsCount);
|
||||
QFETCH(int, expectedDataTagsCount);
|
||||
|
||||
CppTools::Tests::ProjectOpenerAndCloser projectManager;
|
||||
CppEditor::Tests::ProjectOpenerAndCloser projectManager;
|
||||
QVERIFY(projectManager.open(projectFilePath, true, m_kit));
|
||||
|
||||
QSignalSpy parserSpy(m_model->parser(), SIGNAL(parsingFinished()));
|
||||
@@ -156,7 +156,7 @@ void AutoTestUnitTests::testCodeParserSwitchStartup()
|
||||
QFETCH(QList<int>, expectedUnnamedQuickTestsCount);
|
||||
QFETCH(QList<int>, expectedDataTagsCount);
|
||||
|
||||
CppTools::Tests::ProjectOpenerAndCloser projectManager;
|
||||
CppEditor::Tests::ProjectOpenerAndCloser projectManager;
|
||||
for (int i = 0; i < projectFilePaths.size(); ++i) {
|
||||
qDebug() << "Opening project" << projectFilePaths.at(i);
|
||||
QVERIFY(projectManager.open(projectFilePaths.at(i), true, m_kit));
|
||||
@@ -205,7 +205,7 @@ void AutoTestUnitTests::testCodeParserGTest()
|
||||
QSKIP("This test needs googletest - set GOOGLETEST_DIR (point to googletest repository)");
|
||||
|
||||
QFETCH(QString, projectFilePath);
|
||||
CppTools::Tests::ProjectOpenerAndCloser projectManager;
|
||||
CppEditor::Tests::ProjectOpenerAndCloser projectManager;
|
||||
QVERIFY(projectManager.open(projectFilePath, true, m_kit));
|
||||
|
||||
QSignalSpy parserSpy(m_model->parser(), SIGNAL(parsingFinished()));
|
||||
@@ -254,8 +254,8 @@ void AutoTestUnitTests::testCodeParserBoostTest()
|
||||
|
||||
QFETCH(QString, projectFilePath);
|
||||
QFETCH(QString, extension);
|
||||
CppTools::Tests::ProjectOpenerAndCloser projectManager;
|
||||
const CppTools::ProjectInfo::ConstPtr projectInfo
|
||||
CppEditor::Tests::ProjectOpenerAndCloser projectManager;
|
||||
const CppEditor::ProjectInfo::ConstPtr projectInfo
|
||||
= projectManager.open(projectFilePath, true, m_kit);
|
||||
QVERIFY(projectInfo);
|
||||
|
||||
|
@@ -27,7 +27,7 @@
|
||||
|
||||
#include <QObject>
|
||||
|
||||
namespace CppTools { namespace Tests { class TemporaryCopiedDir; } }
|
||||
namespace CppEditor { namespace Tests { class TemporaryCopiedDir; } }
|
||||
namespace ProjectExplorer { class Kit; }
|
||||
|
||||
namespace Autotest {
|
||||
@@ -60,7 +60,7 @@ private slots:
|
||||
|
||||
private:
|
||||
TestTreeModel *m_model = nullptr;
|
||||
CppTools::Tests::TemporaryCopiedDir *m_tmpDir = nullptr;
|
||||
CppEditor::Tests::TemporaryCopiedDir *m_tmpDir = nullptr;
|
||||
bool m_isQt4 = false;
|
||||
bool m_checkBoost = false;
|
||||
ProjectExplorer::Kit *m_kit = nullptr;
|
||||
|
@@ -28,7 +28,7 @@
|
||||
#include "boosttestframework.h"
|
||||
#include "boosttesttreeitem.h"
|
||||
|
||||
#include <cpptools/cppmodelmanager.h>
|
||||
#include <cppeditor/cppmodelmanager.h>
|
||||
|
||||
#include <QMap>
|
||||
#include <QRegularExpression>
|
||||
@@ -125,12 +125,12 @@ bool BoostTestParser::processDocument(QFutureInterface<TestParseResultPtr> &futu
|
||||
if (doc.isNull() || !includesBoostTest(doc, m_cppSnapshot) || !hasBoostTestMacros(doc))
|
||||
return false;
|
||||
|
||||
const CppTools::CppModelManager *modelManager = CppTools::CppModelManager::instance();
|
||||
const QList<CppTools::ProjectPart::ConstPtr> projectParts
|
||||
const CppEditor::CppModelManager *modelManager = CppEditor::CppModelManager::instance();
|
||||
const QList<CppEditor::ProjectPart::ConstPtr> projectParts
|
||||
= modelManager->projectPart(fileName);
|
||||
if (projectParts.isEmpty()) // happens if shutting down while parsing
|
||||
return false;
|
||||
const CppTools::ProjectPart::ConstPtr projectPart = projectParts.first();
|
||||
const CppEditor::ProjectPart::ConstPtr projectPart = projectParts.first();
|
||||
const auto projectFile = Utils::FilePath::fromString(projectPart->projectFile);
|
||||
const QByteArray &fileContent = getFileContent(fileName);
|
||||
|
||||
|
@@ -30,7 +30,7 @@
|
||||
#include "boosttestparser.h"
|
||||
#include "../testframeworkmanager.h"
|
||||
|
||||
#include <cpptools/cppmodelmanager.h>
|
||||
#include <cppeditor/cppmodelmanager.h>
|
||||
#include <projectexplorer/session.h>
|
||||
#include <utils/qtcassert.h>
|
||||
|
||||
@@ -195,7 +195,7 @@ QList<ITestConfiguration *> BoostTestTreeItem::getAllTestConfigurations() const
|
||||
++funcChildren;
|
||||
});
|
||||
if (funcChildren) {
|
||||
const auto cppMM = CppTools::CppModelManager::instance();
|
||||
const auto cppMM = CppEditor::CppModelManager::instance();
|
||||
QTC_ASSERT(cppMM, return);
|
||||
testsPerProjectfile[item->proFile()].testCases += funcChildren;
|
||||
testsPerProjectfile[item->proFile()].internalTargets.unite(cppMM->internalTargets(item->filePath()));
|
||||
@@ -236,7 +236,7 @@ QList<ITestConfiguration *> BoostTestTreeItem::getTestConfigurations(
|
||||
if (!item->enabled()) // ignore child tests known to be disabled when using run selected
|
||||
return;
|
||||
if (predicate(item)) {
|
||||
const auto cppMM = CppTools::CppModelManager::instance();
|
||||
const auto cppMM = CppEditor::CppModelManager::instance();
|
||||
QTC_ASSERT(cppMM, return);
|
||||
QString tcName = item->name();
|
||||
if (item->state().testFlag(BoostTestTreeItem::Templated))
|
||||
@@ -282,7 +282,7 @@ ITestConfiguration *BoostTestTreeItem::testConfiguration() const
|
||||
{
|
||||
ProjectExplorer::Project *project = ProjectExplorer::SessionManager::startupProject();
|
||||
QTC_ASSERT(project, return nullptr);
|
||||
const auto cppMM = CppTools::CppModelManager::instance();
|
||||
const auto cppMM = CppEditor::CppModelManager::instance();
|
||||
QTC_ASSERT(cppMM, return nullptr);
|
||||
|
||||
const Type itemType = type();
|
||||
|
@@ -28,8 +28,8 @@
|
||||
#include "catchframework.h"
|
||||
#include "catchtreeitem.h"
|
||||
|
||||
#include <cpptools/cppmodelmanager.h>
|
||||
#include <cpptools/projectpart.h>
|
||||
#include <cppeditor/cppmodelmanager.h>
|
||||
#include <cppeditor/projectpart.h>
|
||||
#include <utils/qtcassert.h>
|
||||
|
||||
#include <QRegularExpression>
|
||||
@@ -118,7 +118,7 @@ bool CatchTestParser::processDocument(QFutureInterface<TestParseResultPtr> &futu
|
||||
if (doc.isNull() || !includesCatchHeader(doc, m_cppSnapshot))
|
||||
return false;
|
||||
|
||||
const CppTools::CppModelManager *modelManager = CppTools::CppModelManager::instance();
|
||||
const CppEditor::CppModelManager *modelManager = CppEditor::CppModelManager::instance();
|
||||
const QString &filePath = doc->fileName();
|
||||
const QByteArray &fileContent = getFileContent(fileName);
|
||||
|
||||
@@ -133,11 +133,11 @@ bool CatchTestParser::processDocument(QFutureInterface<TestParseResultPtr> &futu
|
||||
}
|
||||
|
||||
|
||||
const QList<CppTools::ProjectPart::ConstPtr> projectParts = modelManager->projectPart(fileName);
|
||||
const QList<CppEditor::ProjectPart::ConstPtr> projectParts = modelManager->projectPart(fileName);
|
||||
if (projectParts.isEmpty()) // happens if shutting down while parsing
|
||||
return false;
|
||||
Utils::FilePath proFile;
|
||||
const CppTools::ProjectPart::ConstPtr projectPart = projectParts.first();
|
||||
const CppEditor::ProjectPart::ConstPtr projectPart = projectParts.first();
|
||||
proFile = Utils::FilePath::fromString(projectPart->projectFile);
|
||||
|
||||
CatchCodeParser codeParser(fileContent, projectPart->languageFeatures);
|
||||
|
@@ -27,7 +27,7 @@
|
||||
#include "catchconfiguration.h"
|
||||
#include "catchframework.h"
|
||||
|
||||
#include <cpptools/cppmodelmanager.h>
|
||||
#include <cppeditor/cppmodelmanager.h>
|
||||
#include <projectexplorer/project.h>
|
||||
#include <projectexplorer/session.h>
|
||||
#include <utils/qtcassert.h>
|
||||
@@ -157,7 +157,7 @@ ITestConfiguration *CatchTreeItem::testConfiguration() const
|
||||
{
|
||||
ProjectExplorer::Project *project = ProjectExplorer::SessionManager::startupProject();
|
||||
QTC_ASSERT(project, return nullptr);
|
||||
const auto cppMM = CppTools::CppModelManager::instance();
|
||||
const auto cppMM = CppEditor::CppModelManager::instance();
|
||||
QTC_ASSERT(cppMM, return nullptr);
|
||||
|
||||
if (type() != TestCase)
|
||||
@@ -192,7 +192,7 @@ static void collectTestInfo(const TestTreeItem *item,
|
||||
bool ignoreCheckState)
|
||||
{
|
||||
QTC_ASSERT(item, return);
|
||||
const auto cppMM = CppTools::CppModelManager::instance();
|
||||
const auto cppMM = CppEditor::CppModelManager::instance();
|
||||
QTC_ASSERT(cppMM, return);
|
||||
const int childCount = item->childCount();
|
||||
if (item->type() == TestTreeItem::GroupNode) {
|
||||
@@ -234,7 +234,7 @@ static void collectFailedTestInfo(const CatchTreeItem *item,
|
||||
item->forAllChildItems([&testCasesForProfile](TestTreeItem *it) {
|
||||
QTC_ASSERT(it, return);
|
||||
QTC_ASSERT(it->parentItem(), return);
|
||||
const auto cppMM = CppTools::CppModelManager::instance();
|
||||
const auto cppMM = CppEditor::CppModelManager::instance();
|
||||
QTC_ASSERT(cppMM, return);
|
||||
if (it->type() == TestTreeItem::TestCase && it->data(0, FailedRole).toBool()) {
|
||||
CatchTreeItem *current = static_cast<CatchTreeItem *>(it);
|
||||
@@ -282,7 +282,7 @@ QList<ITestConfiguration *> CatchTreeItem::getFailedTestConfigurations() const
|
||||
QList<ITestConfiguration *> CatchTreeItem::getTestConfigurationsForFile(const Utils::FilePath &fileName) const
|
||||
{
|
||||
QList<ITestConfiguration *> result;
|
||||
const auto cppMM = CppTools::CppModelManager::instance();
|
||||
const auto cppMM = CppEditor::CppModelManager::instance();
|
||||
QTC_ASSERT(cppMM, return result);
|
||||
|
||||
ProjectExplorer::Project *project = ProjectExplorer::SessionManager::startupProject();
|
||||
|
@@ -29,8 +29,8 @@
|
||||
#include "gtestvisitors.h"
|
||||
#include "gtest_utils.h"
|
||||
|
||||
#include <cpptools/cppmodelmanager.h>
|
||||
#include <cpptools/projectpart.h>
|
||||
#include <cppeditor/cppmodelmanager.h>
|
||||
#include <cppeditor/projectpart.h>
|
||||
|
||||
#include <QRegularExpression>
|
||||
#include <QRegularExpressionMatch>
|
||||
@@ -107,7 +107,7 @@ bool GTestParser::processDocument(QFutureInterface<TestParseResultPtr> &futureIn
|
||||
}
|
||||
|
||||
const QString &filePath = doc->fileName();
|
||||
const CppTools::CppModelManager *modelManager = CppTools::CppModelManager::instance();
|
||||
const CppEditor::CppModelManager *modelManager = CppEditor::CppModelManager::instance();
|
||||
CPlusPlus::Document::Ptr document = m_cppSnapshot.preprocessedDocument(fileContent, fileName);
|
||||
document->check();
|
||||
CPlusPlus::AST *ast = document->translationUnit()->ast();
|
||||
@@ -116,7 +116,7 @@ bool GTestParser::processDocument(QFutureInterface<TestParseResultPtr> &futureIn
|
||||
|
||||
const QMap<GTestCaseSpec, GTestCodeLocationList> result = visitor.gtestFunctions();
|
||||
Utils::FilePath proFile;
|
||||
const QList<CppTools::ProjectPart::ConstPtr> &ppList = modelManager->projectPart(filePath);
|
||||
const QList<CppEditor::ProjectPart::ConstPtr> &ppList = modelManager->projectPart(filePath);
|
||||
if (!ppList.isEmpty())
|
||||
proFile = Utils::FilePath::fromString(ppList.first()->projectFile);
|
||||
else
|
||||
|
@@ -30,7 +30,7 @@
|
||||
#include "gtestparser.h"
|
||||
#include "../testframeworkmanager.h"
|
||||
|
||||
#include <cpptools/cppmodelmanager.h>
|
||||
#include <cppeditor/cppmodelmanager.h>
|
||||
#include <projectexplorer/session.h>
|
||||
|
||||
#include <utils/algorithm.h>
|
||||
@@ -522,18 +522,18 @@ QString GTestTreeItem::nameSuffix() const
|
||||
QSet<QString> internalTargets(const TestTreeItem &item)
|
||||
{
|
||||
QSet<QString> result;
|
||||
const auto cppMM = CppTools::CppModelManager::instance();
|
||||
const auto cppMM = CppEditor::CppModelManager::instance();
|
||||
const auto projectInfo = cppMM->projectInfo(ProjectExplorer::SessionManager::startupProject());
|
||||
if (!projectInfo)
|
||||
return {};
|
||||
const Utils::FilePath filePath = item.filePath();
|
||||
const QString file = filePath.toString();
|
||||
const QVector<CppTools::ProjectPart::ConstPtr> projectParts = projectInfo->projectParts();
|
||||
const QVector<CppEditor::ProjectPart::ConstPtr> projectParts = projectInfo->projectParts();
|
||||
if (projectParts.isEmpty())
|
||||
return cppMM->dependingInternalTargets(item.filePath());
|
||||
for (const CppTools::ProjectPart::ConstPtr &projectPart : projectParts) {
|
||||
for (const CppEditor::ProjectPart::ConstPtr &projectPart : projectParts) {
|
||||
if (Utils::FilePath::fromString(projectPart->projectFile) == item.proFile()
|
||||
&& Utils::anyOf(projectPart->files, [&file] (const CppTools::ProjectFile &pf) {
|
||||
&& Utils::anyOf(projectPart->files, [&file] (const CppEditor::ProjectFile &pf) {
|
||||
return pf.path == file;
|
||||
})) {
|
||||
result.insert(projectPart->buildSystemTarget);
|
||||
|
@@ -26,7 +26,7 @@
|
||||
#include "itestparser.h"
|
||||
|
||||
#include <coreplugin/editormanager/editormanager.h>
|
||||
#include <cpptools/cppmodelmanager.h>
|
||||
#include <cppeditor/cppmodelmanager.h>
|
||||
#include <utils/textfileformat.h>
|
||||
#include <utils/algorithm.h>
|
||||
|
||||
@@ -48,14 +48,14 @@ void CppParser::init(const Utils::FilePaths &filesToParse, bool fullParse)
|
||||
{
|
||||
Q_UNUSED(filesToParse)
|
||||
Q_UNUSED(fullParse)
|
||||
m_cppSnapshot = CppTools::CppModelManager::instance()->snapshot();
|
||||
m_workingCopy = CppTools::CppModelManager::instance()->workingCopy();
|
||||
m_cppSnapshot = CppEditor::CppModelManager::instance()->snapshot();
|
||||
m_workingCopy = CppEditor::CppModelManager::instance()->workingCopy();
|
||||
}
|
||||
|
||||
bool CppParser::selectedForBuilding(const Utils::FilePath &fileName)
|
||||
{
|
||||
QList<CppTools::ProjectPart::ConstPtr> projParts =
|
||||
CppTools::CppModelManager::instance()->projectPart(fileName);
|
||||
QList<CppEditor::ProjectPart::ConstPtr> projParts =
|
||||
CppEditor::CppModelManager::instance()->projectPart(fileName);
|
||||
|
||||
return !projParts.isEmpty() && projParts.at(0)->selectedForBuilding;
|
||||
}
|
||||
@@ -82,8 +82,8 @@ bool precompiledHeaderContains(const CPlusPlus::Snapshot &snapshot,
|
||||
const QString &cacheString,
|
||||
const std::function<bool(const QString &)> &checker)
|
||||
{
|
||||
const CppTools::CppModelManager *modelManager = CppTools::CppModelManager::instance();
|
||||
const QList<CppTools::ProjectPart::ConstPtr> projectParts = modelManager->projectPart(filePath);
|
||||
const CppEditor::CppModelManager *modelManager = CppEditor::CppModelManager::instance();
|
||||
const QList<CppEditor::ProjectPart::ConstPtr> projectParts = modelManager->projectPart(filePath);
|
||||
if (projectParts.isEmpty())
|
||||
return false;
|
||||
const QStringList precompiledHeaders = projectParts.first()->precompiledHeaders;
|
||||
@@ -128,7 +128,7 @@ bool CppParser::precompiledHeaderContains(const CPlusPlus::Snapshot &snapshot,
|
||||
void CppParser::release()
|
||||
{
|
||||
m_cppSnapshot = CPlusPlus::Snapshot();
|
||||
m_workingCopy = CppTools::WorkingCopy();
|
||||
m_workingCopy = CppEditor::WorkingCopy();
|
||||
QMutexLocker l(s_cacheMutex());
|
||||
s_pchLookupCache.clear();
|
||||
}
|
||||
|
@@ -28,7 +28,7 @@
|
||||
#include "testtreeitem.h"
|
||||
|
||||
#include <cplusplus/CppDocument.h>
|
||||
#include <cpptools/cppworkingcopy.h>
|
||||
#include <cppeditor/cppworkingcopy.h>
|
||||
#include <qmljs/qmljsdocument.h>
|
||||
|
||||
#include <QFutureInterface>
|
||||
@@ -98,7 +98,7 @@ public:
|
||||
|
||||
protected:
|
||||
CPlusPlus::Snapshot m_cppSnapshot;
|
||||
CppTools::WorkingCopy m_workingCopy;
|
||||
CppEditor::WorkingCopy m_workingCopy;
|
||||
};
|
||||
|
||||
} // namespace Autotest
|
||||
|
@@ -25,8 +25,8 @@
|
||||
|
||||
#include "loadprojectscenario.h"
|
||||
|
||||
#include <cpptools/cpptoolstestcase.h>
|
||||
#include <cpptools/projectinfo.h>
|
||||
#include <cppeditor/cpptoolstestcase.h>
|
||||
#include <cppeditor/projectinfo.h>
|
||||
|
||||
#include <qtsupport/qtkitinformation.h>
|
||||
|
||||
@@ -82,7 +82,7 @@ bool LoadProjectScenario::init()
|
||||
return false;
|
||||
}
|
||||
|
||||
m_tmpDir = new CppTools::Tests::TemporaryCopiedDir(":/unit_test");
|
||||
m_tmpDir = new CppEditor::Tests::TemporaryCopiedDir(":/unit_test");
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -90,9 +90,9 @@ bool LoadProjectScenario::loadProject()
|
||||
{
|
||||
const QString projectFilePath = m_tmpDir->path() + "/plain/plain.pro";
|
||||
|
||||
CppTools::Tests::ProjectOpenerAndCloser projectManager;
|
||||
CppEditor::Tests::ProjectOpenerAndCloser projectManager;
|
||||
// This code must trigger a call to PluginManager::finishScenario() at some later point.
|
||||
const CppTools::ProjectInfo::ConstPtr projectInfo = projectManager.open(projectFilePath,
|
||||
const CppEditor::ProjectInfo::ConstPtr projectInfo = projectManager.open(projectFilePath,
|
||||
true, m_kit);
|
||||
return projectInfo.get();
|
||||
}
|
||||
|
@@ -27,7 +27,7 @@
|
||||
|
||||
#include <QObject>
|
||||
|
||||
namespace CppTools { namespace Tests { class TemporaryCopiedDir; } }
|
||||
namespace CppEditor { namespace Tests { class TemporaryCopiedDir; } }
|
||||
namespace ProjectExplorer { class Kit; }
|
||||
|
||||
namespace Autotest {
|
||||
@@ -50,7 +50,7 @@ private:
|
||||
bool loadProject();
|
||||
|
||||
TestTreeModel *m_model = nullptr;
|
||||
CppTools::Tests::TemporaryCopiedDir *m_tmpDir = nullptr;
|
||||
CppEditor::Tests::TemporaryCopiedDir *m_tmpDir = nullptr;
|
||||
ProjectExplorer::Kit *m_kit = nullptr;
|
||||
};
|
||||
|
||||
|
@@ -27,8 +27,8 @@
|
||||
#include "qttestframework.h"
|
||||
#include "qttestvisitors.h"
|
||||
|
||||
#include <cpptools/cppmodelmanager.h>
|
||||
#include <cpptools/projectpart.h>
|
||||
#include <cppeditor/cppmodelmanager.h>
|
||||
#include <cppeditor/projectpart.h>
|
||||
#include <cplusplus/TypeOfExpression.h>
|
||||
#include <utils/algorithm.h>
|
||||
|
||||
@@ -93,8 +93,8 @@ static bool includesQtTest(const CPlusPlus::Document::Ptr &doc, const CPlusPlus:
|
||||
|
||||
static bool qtTestLibDefined(const Utils::FilePath &fileName)
|
||||
{
|
||||
const QList<CppTools::ProjectPart::ConstPtr> parts =
|
||||
CppTools::CppModelManager::instance()->projectPart(fileName);
|
||||
const QList<CppEditor::ProjectPart::ConstPtr> parts =
|
||||
CppEditor::CppModelManager::instance()->projectPart(fileName);
|
||||
if (parts.size() > 0) {
|
||||
return Utils::anyOf(parts.at(0)->projectMacros, [] (const ProjectExplorer::Macro ¯o) {
|
||||
return macro.key == "QT_TESTLIB_LIB";
|
||||
@@ -103,7 +103,7 @@ static bool qtTestLibDefined(const Utils::FilePath &fileName)
|
||||
return false;
|
||||
}
|
||||
|
||||
TestCases QtTestParser::testCases(const CppTools::CppModelManager *modelManager,
|
||||
TestCases QtTestParser::testCases(const CppEditor::CppModelManager *modelManager,
|
||||
const Utils::FilePath &fileName) const
|
||||
{
|
||||
const QByteArray &fileContent = getFileContent(fileName);
|
||||
@@ -314,7 +314,7 @@ bool QtTestParser::processDocument(QFutureInterface<TestParseResultPtr> &futureI
|
||||
return false;
|
||||
}
|
||||
|
||||
const CppTools::CppModelManager *modelManager = CppTools::CppModelManager::instance();
|
||||
const CppEditor::CppModelManager *modelManager = CppEditor::CppModelManager::instance();
|
||||
TestCases testCaseList(testCases(modelManager, fileName));
|
||||
bool reported = false;
|
||||
// we might be in a reparse without the original entry point with the QTest::qExec()
|
||||
@@ -327,7 +327,7 @@ bool QtTestParser::processDocument(QFutureInterface<TestParseResultPtr> &futureI
|
||||
if (earlyReturn.has_value() || !data.valid)
|
||||
continue;
|
||||
|
||||
QList<CppTools::ProjectPart::ConstPtr> projectParts
|
||||
QList<CppEditor::ProjectPart::ConstPtr> projectParts
|
||||
= modelManager->projectPart(fileName);
|
||||
if (projectParts.isEmpty()) // happens if shutting down while parsing
|
||||
return false;
|
||||
|
@@ -32,7 +32,7 @@
|
||||
|
||||
#include <utils/optional.h>
|
||||
|
||||
namespace CppTools { class CppModelManager; }
|
||||
namespace CppEditor { class CppModelManager; }
|
||||
|
||||
namespace Autotest {
|
||||
namespace Internal {
|
||||
@@ -62,7 +62,7 @@ public:
|
||||
const Utils::FilePath &fileName) override;
|
||||
|
||||
private:
|
||||
TestCases testCases(const CppTools::CppModelManager *modelManager,
|
||||
TestCases testCases(const CppEditor::CppModelManager *modelManager,
|
||||
const Utils::FilePath &fileName) const;
|
||||
QHash<QString, QtTestCodeLocationList> checkForDataTags(const Utils::FilePath &fileName) const;
|
||||
struct TestCaseData {
|
||||
|
@@ -28,7 +28,7 @@
|
||||
#include "qttestparser.h"
|
||||
#include "qttestframework.h"
|
||||
|
||||
#include <cpptools/cppmodelmanager.h>
|
||||
#include <cppeditor/cppmodelmanager.h>
|
||||
#include <projectexplorer/session.h>
|
||||
#include <utils/qtcassert.h>
|
||||
|
||||
@@ -130,7 +130,7 @@ ITestConfiguration *QtTestTreeItem::testConfiguration() const
|
||||
{
|
||||
ProjectExplorer::Project *project = ProjectExplorer::SessionManager::startupProject();
|
||||
QTC_ASSERT(project, return nullptr);
|
||||
const auto cppMM = CppTools::CppModelManager::instance();
|
||||
const auto cppMM = CppEditor::CppModelManager::instance();
|
||||
QTC_ASSERT(cppMM, return nullptr);
|
||||
|
||||
QtTestConfiguration *config = nullptr;
|
||||
@@ -172,7 +172,7 @@ ITestConfiguration *QtTestTreeItem::testConfiguration() const
|
||||
static void fillTestConfigurationsFromCheckState(const TestTreeItem *item,
|
||||
QList<ITestConfiguration *> &testConfigurations)
|
||||
{
|
||||
const auto cppMM = CppTools::CppModelManager::instance();
|
||||
const auto cppMM = CppEditor::CppModelManager::instance();
|
||||
QTC_ASSERT(cppMM, return);
|
||||
QTC_ASSERT(item, return);
|
||||
if (item->type() == TestTreeItem::GroupNode) {
|
||||
@@ -215,7 +215,7 @@ static void fillTestConfigurationsFromCheckState(const TestTreeItem *item,
|
||||
|
||||
static void collectFailedTestInfo(TestTreeItem *item, QList<ITestConfiguration *> &testConfigs)
|
||||
{
|
||||
const auto cppMM = CppTools::CppModelManager::instance();
|
||||
const auto cppMM = CppEditor::CppModelManager::instance();
|
||||
QTC_ASSERT(cppMM, return);
|
||||
QTC_ASSERT(item, return);
|
||||
if (item->type() == TestTreeItem::GroupNode) {
|
||||
|
@@ -29,7 +29,7 @@
|
||||
#include <cplusplus/LookupContext.h>
|
||||
#include <cplusplus/Symbols.h>
|
||||
#include <cplusplus/TypeOfExpression.h>
|
||||
#include <cpptools/cppmodelmanager.h>
|
||||
#include <cppeditor/cppmodelmanager.h>
|
||||
#include <utils/algorithm.h>
|
||||
#include <utils/qtcassert.h>
|
||||
|
||||
|
@@ -33,7 +33,7 @@
|
||||
#include <cplusplus/Overview.h>
|
||||
#include <cplusplus/Scope.h>
|
||||
#include <cplusplus/SymbolVisitor.h>
|
||||
#include <cpptools/symbolfinder.h>
|
||||
#include <cppeditor/symbolfinder.h>
|
||||
|
||||
#include <QMap>
|
||||
#include <QSet>
|
||||
@@ -54,7 +54,7 @@ public:
|
||||
bool visit(CPlusPlus::Class *symbol) override;
|
||||
|
||||
private:
|
||||
CppTools::SymbolFinder m_symbolFinder;
|
||||
CppEditor::SymbolFinder m_symbolFinder;
|
||||
QString m_className;
|
||||
CPlusPlus::Snapshot m_snapshot;
|
||||
QMap<QString, QtTestCodeLocationAndType> m_privSlots;
|
||||
|
@@ -31,8 +31,8 @@
|
||||
#include "../testcodeparser.h"
|
||||
#include "../testtreemodel.h"
|
||||
|
||||
#include <cpptools/cppmodelmanager.h>
|
||||
#include <cpptools/projectpart.h>
|
||||
#include <cppeditor/cppmodelmanager.h>
|
||||
#include <cppeditor/projectpart.h>
|
||||
#include <projectexplorer/session.h>
|
||||
#include <qmljs/parser/qmljsast_p.h>
|
||||
#include <qmljs/qmljsdialect.h>
|
||||
@@ -98,10 +98,10 @@ static bool includesQtQuickTest(const CPlusPlus::Document::Ptr &doc,
|
||||
return false;
|
||||
}
|
||||
|
||||
static QString quickTestSrcDir(const CppTools::CppModelManager *cppMM,
|
||||
static QString quickTestSrcDir(const CppEditor::CppModelManager *cppMM,
|
||||
const Utils::FilePath &fileName)
|
||||
{
|
||||
const QList<CppTools::ProjectPart::ConstPtr> parts = cppMM->projectPart(fileName);
|
||||
const QList<CppEditor::ProjectPart::ConstPtr> parts = cppMM->projectPart(fileName);
|
||||
if (parts.size() > 0) {
|
||||
const ProjectExplorer::Macros ¯os = parts.at(0)->projectMacros;
|
||||
auto found = std::find_if(
|
||||
@@ -263,11 +263,11 @@ bool QuickTestParser::handleQtQuickTest(QFutureInterface<TestParseResultPtr> &fu
|
||||
CPlusPlus::Document::Ptr document,
|
||||
ITestFramework *framework)
|
||||
{
|
||||
const CppTools::CppModelManager *modelManager = CppTools::CppModelManager::instance();
|
||||
const CppEditor::CppModelManager *modelManager = CppEditor::CppModelManager::instance();
|
||||
if (quickTestName(document).isEmpty())
|
||||
return false;
|
||||
|
||||
QList<CppTools::ProjectPart::ConstPtr> ppList = modelManager->projectPart(document->fileName());
|
||||
QList<CppEditor::ProjectPart::ConstPtr> ppList = modelManager->projectPart(document->fileName());
|
||||
if (ppList.isEmpty()) // happens if shutting down while parsing
|
||||
return false;
|
||||
const Utils::FilePath cppFileName = Utils::FilePath::fromString(document->fileName());
|
||||
|
@@ -29,7 +29,7 @@
|
||||
#include "quicktestparser.h"
|
||||
#include "../testframeworkmanager.h"
|
||||
|
||||
#include <cpptools/cppmodelmanager.h>
|
||||
#include <cppeditor/cppmodelmanager.h>
|
||||
#include <projectexplorer/session.h>
|
||||
#include <utils/qtcassert.h>
|
||||
|
||||
@@ -387,11 +387,11 @@ bool QuickTestTreeItem::isGroupable() const
|
||||
QSet<QString> internalTargets(const Utils::FilePath &proFile)
|
||||
{
|
||||
QSet<QString> result;
|
||||
const auto cppMM = CppTools::CppModelManager::instance();
|
||||
const auto cppMM = CppEditor::CppModelManager::instance();
|
||||
const auto projectInfo = cppMM->projectInfo(ProjectExplorer::SessionManager::startupProject());
|
||||
if (!projectInfo)
|
||||
return {};
|
||||
for (const CppTools::ProjectPart::ConstPtr &projectPart : projectInfo->projectParts()) {
|
||||
for (const CppEditor::ProjectPart::ConstPtr &projectPart : projectInfo->projectParts()) {
|
||||
if (projectPart->buildTargetType != ProjectExplorer::BuildTargetType::Executable)
|
||||
continue;
|
||||
if (projectPart->projectFile == proFile.toString())
|
||||
|
@@ -33,8 +33,8 @@
|
||||
#include <coreplugin/editormanager/editormanager.h>
|
||||
#include <coreplugin/progressmanager/futureprogress.h>
|
||||
#include <coreplugin/progressmanager/progressmanager.h>
|
||||
#include <cpptools/cppmodelmanager.h>
|
||||
#include <cpptools/cpptoolsconstants.h>
|
||||
#include <cppeditor/cppeditorconstants.h>
|
||||
#include <cppeditor/cppmodelmanager.h>
|
||||
#include <projectexplorer/project.h>
|
||||
#include <projectexplorer/session.h>
|
||||
#include <qmljstools/qmljsmodelmanager.h>
|
||||
@@ -373,7 +373,7 @@ void TestCodeParser::scanForTests(const Utils::FilePaths &fileList,
|
||||
|
||||
void TestCodeParser::onTaskStarted(Utils::Id type)
|
||||
{
|
||||
if (type == CppTools::Constants::TASK_INDEX) {
|
||||
if (type == CppEditor::Constants::TASK_INDEX) {
|
||||
m_codeModelParsing = true;
|
||||
if (m_parserState == FullParse || m_parserState == PartialParse) {
|
||||
m_postponedUpdateType = m_parserState == FullParse
|
||||
@@ -392,7 +392,7 @@ void TestCodeParser::onAllTasksFinished(Utils::Id type)
|
||||
emit parsingFailed();
|
||||
|
||||
// only CPP parsing is relevant as we trigger Qml parsing internally anyway
|
||||
if (type != CppTools::Constants::TASK_INDEX)
|
||||
if (type != CppEditor::Constants::TASK_INDEX)
|
||||
return;
|
||||
m_codeModelParsing = false;
|
||||
|
||||
|
@@ -29,8 +29,8 @@
|
||||
#include "testoutputreader.h"
|
||||
#include "testrunconfiguration.h"
|
||||
|
||||
#include <cpptools/cppmodelmanager.h>
|
||||
#include <cpptools/projectinfo.h>
|
||||
#include <cppeditor/cppmodelmanager.h>
|
||||
#include <cppeditor/projectinfo.h>
|
||||
|
||||
#include <projectexplorer/buildconfiguration.h>
|
||||
#include <projectexplorer/buildsystem.h>
|
||||
|
@@ -32,7 +32,7 @@
|
||||
#include "testprojectsettings.h"
|
||||
#include "testsettings.h"
|
||||
|
||||
#include <cpptools/cppmodelmanager.h>
|
||||
#include <cppeditor/cppmodelmanager.h>
|
||||
#include <projectexplorer/buildsystem.h>
|
||||
#include <projectexplorer/project.h>
|
||||
#include <projectexplorer/session.h>
|
||||
@@ -111,16 +111,16 @@ void TestTreeModel::setupParsingConnections()
|
||||
}
|
||||
});
|
||||
|
||||
CppTools::CppModelManager *cppMM = CppTools::CppModelManager::instance();
|
||||
connect(cppMM, &CppTools::CppModelManager::documentUpdated,
|
||||
CppEditor::CppModelManager *cppMM = CppEditor::CppModelManager::instance();
|
||||
connect(cppMM, &CppEditor::CppModelManager::documentUpdated,
|
||||
m_parser, &TestCodeParser::onCppDocumentUpdated, Qt::QueuedConnection);
|
||||
connect(cppMM, &CppTools::CppModelManager::aboutToRemoveFiles,
|
||||
connect(cppMM, &CppEditor::CppModelManager::aboutToRemoveFiles,
|
||||
this, [this](const QStringList &files) {
|
||||
const Utils::FilePaths filesToRemove
|
||||
= Utils::transform(files, &Utils::FilePath::fromString);
|
||||
removeFiles(filesToRemove);
|
||||
}, Qt::QueuedConnection);
|
||||
connect(cppMM, &CppTools::CppModelManager::projectPartsUpdated,
|
||||
connect(cppMM, &CppEditor::CppModelManager::projectPartsUpdated,
|
||||
m_parser, &TestCodeParser::onProjectPartsUpdated);
|
||||
|
||||
QmlJS::ModelManagerInterface *qmlJsMM = QmlJS::ModelManagerInterface::instance();
|
||||
|
@@ -1,5 +1,5 @@
|
||||
add_qtc_plugin(AutotoolsProjectManager
|
||||
PLUGIN_DEPENDS Core CppTools ProjectExplorer QtSupport
|
||||
PLUGIN_DEPENDS Core CppEditor ProjectExplorer QtSupport
|
||||
SOURCES
|
||||
autogenstep.cpp autogenstep.h
|
||||
autoreconfstep.cpp autoreconfstep.h
|
||||
|
@@ -30,7 +30,7 @@
|
||||
#include "makefileparserthread.h"
|
||||
#include "makestep.h"
|
||||
|
||||
#include <cpptools/cppprojectupdater.h>
|
||||
#include <cppeditor/cppprojectupdater.h>
|
||||
#include <projectexplorer/buildconfiguration.h>
|
||||
#include <projectexplorer/target.h>
|
||||
#include <qtsupport/qtcppkitinfo.h>
|
||||
@@ -44,7 +44,7 @@ namespace Internal {
|
||||
|
||||
AutotoolsBuildSystem::AutotoolsBuildSystem(Target *target)
|
||||
: BuildSystem(target)
|
||||
, m_cppCodeModelUpdater(new CppTools::CppProjectUpdater)
|
||||
, m_cppCodeModelUpdater(new CppEditor::CppProjectUpdater)
|
||||
{
|
||||
connect(target, &Target::activeBuildConfigurationChanged, this, [this]() { requestParse(); });
|
||||
|
||||
|
@@ -29,7 +29,7 @@
|
||||
|
||||
#include <projectexplorer/buildsystem.h>
|
||||
|
||||
namespace CppTools { class CppProjectUpdater; }
|
||||
namespace CppEditor { class CppProjectUpdater; }
|
||||
|
||||
namespace AutotoolsProjectManager {
|
||||
namespace Internal {
|
||||
@@ -64,7 +64,7 @@ private:
|
||||
/// Responsible for parsing the makefiles asynchronously in a thread
|
||||
MakefileParserThread *m_makefileParserThread = nullptr;
|
||||
|
||||
CppTools::CppProjectUpdater *m_cppCodeModelUpdater = nullptr;
|
||||
CppEditor::CppProjectUpdater *m_cppCodeModelUpdater = nullptr;
|
||||
};
|
||||
|
||||
} // namespace Internal
|
||||
|
@@ -8,7 +8,7 @@ QtcPlugin {
|
||||
|
||||
Depends { name: "Core" }
|
||||
Depends { name: "ProjectExplorer" }
|
||||
Depends { name: "CppTools" }
|
||||
Depends { name: "CppEditor" }
|
||||
Depends { name: "QtSupport" }
|
||||
|
||||
files: [
|
||||
|
@@ -5,5 +5,5 @@ QTC_LIB_DEPENDS += \
|
||||
QTC_PLUGIN_DEPENDS += \
|
||||
projectexplorer \
|
||||
coreplugin \
|
||||
cpptools \
|
||||
cppeditor \
|
||||
qtsupport
|
||||
|
@@ -7,7 +7,7 @@ QtcPlugin {
|
||||
Depends { name: "Utils" }
|
||||
|
||||
Depends { name: "Core" }
|
||||
Depends { name: "CppTools" }
|
||||
Depends { name: "CppEditor" }
|
||||
Depends { name: "Debugger" }
|
||||
Depends { name: "ProjectExplorer" }
|
||||
Depends { name: "TextEditor" }
|
||||
|
@@ -26,7 +26,7 @@
|
||||
#include "uvproject.h"
|
||||
#include "uvscserverprovider.h"
|
||||
|
||||
#include <cpptools/cppmodelmanager.h>
|
||||
#include <cppeditor/cppmodelmanager.h>
|
||||
|
||||
#include <debugger/debuggerkitinformation.h>
|
||||
#include <debugger/debuggerruncontrol.h>
|
||||
@@ -38,7 +38,7 @@
|
||||
#include <QFileInfo>
|
||||
#include <QDir>
|
||||
|
||||
using namespace CppTools;
|
||||
using namespace CppEditor;
|
||||
using namespace Debugger;
|
||||
using namespace ProjectExplorer;
|
||||
using namespace Utils;
|
||||
@@ -90,7 +90,7 @@ static void extractAllFiles(const DebuggerRunTool *runTool, QStringList &include
|
||||
FilePaths &headers, FilePaths &sources, FilePaths &assemblers)
|
||||
{
|
||||
const auto project = runTool->runControl()->project();
|
||||
const CppTools::ProjectInfo::ConstPtr info = CppModelManager::instance()->projectInfo(project);
|
||||
const CppEditor::ProjectInfo::ConstPtr info = CppModelManager::instance()->projectInfo(project);
|
||||
if (!info)
|
||||
return;
|
||||
const QVector<ProjectPart::ConstPtr> parts = info->projectParts();
|
||||
|
@@ -6,7 +6,7 @@ endif()
|
||||
add_qtc_plugin(ClangCodeModel
|
||||
CONDITION TARGET libclang
|
||||
DEPENDS ClangSupport CPlusPlus
|
||||
PLUGIN_DEPENDS Core CppEditor CppTools LanguageClient ${TEST_LINK_DEPENDS} TextEditor
|
||||
PLUGIN_DEPENDS Core CppEditor LanguageClient ${TEST_LINK_DEPENDS} TextEditor
|
||||
PLUGIN_TEST_DEPENDS QmakeProjectManager
|
||||
SOURCES
|
||||
clangactivationsequencecontextprocessor.cpp clangactivationsequencecontextprocessor.h
|
||||
|
@@ -34,12 +34,12 @@
|
||||
#include <coreplugin/icore.h>
|
||||
#include <coreplugin/messagemanager.h>
|
||||
|
||||
#include <cpptools/abstracteditorsupport.h>
|
||||
#include <cpptools/baseeditordocumentprocessor.h>
|
||||
#include <cpptools/cppmodelmanager.h>
|
||||
#include <cpptools/editordocumenthandle.h>
|
||||
#include <cpptools/projectinfo.h>
|
||||
#include <cpptools/cpptoolsbridge.h>
|
||||
#include <cppeditor/abstracteditorsupport.h>
|
||||
#include <cppeditor/baseeditordocumentprocessor.h>
|
||||
#include <cppeditor/cppmodelmanager.h>
|
||||
#include <cppeditor/editordocumenthandle.h>
|
||||
#include <cppeditor/projectinfo.h>
|
||||
#include <cppeditor/cpptoolsbridge.h>
|
||||
|
||||
#include <texteditor/codeassist/functionhintproposal.h>
|
||||
#include <texteditor/codeassist/iassistprocessor.h>
|
||||
@@ -152,7 +152,7 @@ void removeDuplicates(Utf8StringVector &visibleEditorDocumentsFilePaths)
|
||||
void removeNonCppEditors(QList<Core::IEditor*> &visibleEditors)
|
||||
{
|
||||
const auto isNotCppEditor = [] (Core::IEditor *editor) {
|
||||
return !CppTools::CppModelManager::isCppEditor(editor);
|
||||
return !CppEditor::CppModelManager::isCppEditor(editor);
|
||||
};
|
||||
|
||||
const auto end = std::remove_if(visibleEditors.begin(),
|
||||
@@ -164,7 +164,7 @@ void removeNonCppEditors(QList<Core::IEditor*> &visibleEditors)
|
||||
|
||||
Utf8StringVector visibleCppEditorDocumentsFilePaths()
|
||||
{
|
||||
auto visibleEditors = CppTools::CppToolsBridge::visibleEditors();
|
||||
auto visibleEditors = CppEditor::CppToolsBridge::visibleEditors();
|
||||
|
||||
removeNonCppEditors(visibleEditors);
|
||||
|
||||
@@ -222,12 +222,12 @@ void BackendCommunicator::documentVisibilityChanged(const Utf8String ¤tEdi
|
||||
void BackendCommunicator::restoreCppEditorDocuments()
|
||||
{
|
||||
resetCppEditorDocumentProcessors();
|
||||
CppTools::CppModelManager::instance()->updateCppEditorDocuments();
|
||||
CppEditor::CppModelManager::instance()->updateCppEditorDocuments();
|
||||
}
|
||||
|
||||
void BackendCommunicator::resetCppEditorDocumentProcessors()
|
||||
{
|
||||
using namespace CppTools;
|
||||
using namespace CppEditor;
|
||||
|
||||
const auto cppEditorDocuments = CppModelManager::instance()->cppEditorDocuments();
|
||||
foreach (CppEditorDocumentHandle *cppEditorDocument, cppEditorDocuments)
|
||||
@@ -236,7 +236,7 @@ void BackendCommunicator::resetCppEditorDocumentProcessors()
|
||||
|
||||
void BackendCommunicator::unsavedFilesUpdatedForUiHeaders()
|
||||
{
|
||||
using namespace CppTools;
|
||||
using namespace CppEditor;
|
||||
|
||||
const auto editorSupports = CppModelManager::instance()->abstractEditorSupports();
|
||||
foreach (const AbstractEditorSupport *es, editorSupports) {
|
||||
@@ -248,14 +248,14 @@ void BackendCommunicator::unsavedFilesUpdatedForUiHeaders()
|
||||
|
||||
void BackendCommunicator::documentsChangedFromCppEditorDocument(const QString &filePath)
|
||||
{
|
||||
const CppTools::CppEditorDocumentHandle *document = cppDocument(filePath);
|
||||
const CppEditor::CppEditorDocumentHandle *document = cppDocument(filePath);
|
||||
QTC_ASSERT(document, return);
|
||||
documentsChanged(filePath, document->contents(), document->revision());
|
||||
}
|
||||
|
||||
void BackendCommunicator::unsavedFilesUpdatedFromCppEditorDocument(const QString &filePath)
|
||||
{
|
||||
const CppTools::CppEditorDocumentHandle *document = cppDocument(filePath);
|
||||
const CppEditor::CppEditorDocumentHandle *document = cppDocument(filePath);
|
||||
QTC_ASSERT(document, return);
|
||||
unsavedFilesUpdated(filePath, document->contents(), document->revision());
|
||||
}
|
||||
@@ -287,7 +287,7 @@ void BackendCommunicator::unsavedFilesUpdated(const QString &filePath,
|
||||
|
||||
static bool documentHasChanged(const QString &filePath, uint revision)
|
||||
{
|
||||
if (CppTools::CppEditorDocumentHandle *document = cppDocument(filePath))
|
||||
if (CppEditor::CppEditorDocumentHandle *document = cppDocument(filePath))
|
||||
return document->sendTracker().shouldSendRevision(revision);
|
||||
|
||||
return true;
|
||||
@@ -308,11 +308,11 @@ void BackendCommunicator::requestAnnotations(const FileContainer &fileContainer)
|
||||
m_sender->requestAnnotations(message);
|
||||
}
|
||||
|
||||
QFuture<CppTools::CursorInfo> BackendCommunicator::requestReferences(
|
||||
QFuture<CppEditor::CursorInfo> BackendCommunicator::requestReferences(
|
||||
const FileContainer &fileContainer,
|
||||
quint32 line,
|
||||
quint32 column,
|
||||
const CppTools::SemanticInfo::LocalUseMap &localUses)
|
||||
const CppEditor::SemanticInfo::LocalUseMap &localUses)
|
||||
{
|
||||
const RequestReferencesMessage message(fileContainer, line, column);
|
||||
m_sender->requestReferences(message);
|
||||
@@ -320,7 +320,7 @@ QFuture<CppTools::CursorInfo> BackendCommunicator::requestReferences(
|
||||
return m_receiver.addExpectedReferencesMessage(message.ticketNumber, localUses);
|
||||
}
|
||||
|
||||
QFuture<CppTools::CursorInfo> BackendCommunicator::requestLocalReferences(
|
||||
QFuture<CppEditor::CursorInfo> BackendCommunicator::requestLocalReferences(
|
||||
const FileContainer &fileContainer,
|
||||
quint32 line,
|
||||
quint32 column)
|
||||
@@ -331,7 +331,7 @@ QFuture<CppTools::CursorInfo> BackendCommunicator::requestLocalReferences(
|
||||
return m_receiver.addExpectedReferencesMessage(message.ticketNumber);
|
||||
}
|
||||
|
||||
QFuture<CppTools::ToolTipInfo> BackendCommunicator::requestToolTip(
|
||||
QFuture<CppEditor::ToolTipInfo> BackendCommunicator::requestToolTip(
|
||||
const FileContainer &fileContainer, quint32 line, quint32 column)
|
||||
{
|
||||
const RequestToolTipMessage message(fileContainer, line, column);
|
||||
@@ -340,7 +340,7 @@ QFuture<CppTools::ToolTipInfo> BackendCommunicator::requestToolTip(
|
||||
return m_receiver.addExpectedToolTipMessage(message.ticketNumber);
|
||||
}
|
||||
|
||||
QFuture<CppTools::SymbolInfo> BackendCommunicator::requestFollowSymbol(
|
||||
QFuture<CppEditor::SymbolInfo> BackendCommunicator::requestFollowSymbol(
|
||||
const FileContainer &curFileContainer,
|
||||
quint32 line,
|
||||
quint32 column)
|
||||
@@ -362,7 +362,7 @@ void BackendCommunicator::documentsChangedWithRevisionCheck(Core::IDocument *doc
|
||||
|
||||
void BackendCommunicator::updateChangeContentStartPosition(const QString &filePath, int position)
|
||||
{
|
||||
if (CppTools::CppEditorDocumentHandle *document = cppDocument(filePath))
|
||||
if (CppEditor::CppEditorDocumentHandle *document = cppDocument(filePath))
|
||||
document->sendTracker().applyContentChange(position);
|
||||
}
|
||||
|
||||
|
@@ -28,7 +28,7 @@
|
||||
#include "clangbackendreceiver.h"
|
||||
#include "clangbackendsender.h"
|
||||
|
||||
#include <cpptools/projectpart.h>
|
||||
#include <cppeditor/projectpart.h>
|
||||
|
||||
#include <clangsupport/clangcodemodelconnectionclient.h>
|
||||
#include <clangsupport/filecontainer.h>
|
||||
@@ -57,7 +57,7 @@ class BackendCommunicator : public QObject
|
||||
public:
|
||||
using FileContainer = ClangBackEnd::FileContainer;
|
||||
using FileContainers = QVector<ClangBackEnd::FileContainer>;
|
||||
using LocalUseMap = CppTools::SemanticInfo::LocalUseMap;
|
||||
using LocalUseMap = CppEditor::SemanticInfo::LocalUseMap;
|
||||
|
||||
public:
|
||||
BackendCommunicator();
|
||||
@@ -92,19 +92,19 @@ public:
|
||||
qint32 funcNameStartColumn = -1);
|
||||
void cancelCompletions(TextEditor::IAssistProcessor *processor);
|
||||
void requestAnnotations(const ClangBackEnd::FileContainer &fileContainer);
|
||||
QFuture<CppTools::CursorInfo> requestReferences(
|
||||
QFuture<CppEditor::CursorInfo> requestReferences(
|
||||
const FileContainer &fileContainer,
|
||||
quint32 line,
|
||||
quint32 column,
|
||||
const LocalUseMap &localUses);
|
||||
QFuture<CppTools::CursorInfo> requestLocalReferences(
|
||||
QFuture<CppEditor::CursorInfo> requestLocalReferences(
|
||||
const FileContainer &fileContainer,
|
||||
quint32 line,
|
||||
quint32 column);
|
||||
QFuture<CppTools::ToolTipInfo> requestToolTip(const FileContainer &fileContainer,
|
||||
QFuture<CppEditor::ToolTipInfo> requestToolTip(const FileContainer &fileContainer,
|
||||
quint32 line,
|
||||
quint32 column);
|
||||
QFuture<CppTools::SymbolInfo> requestFollowSymbol(const FileContainer &curFileContainer,
|
||||
QFuture<CppEditor::SymbolInfo> requestFollowSymbol(const FileContainer &curFileContainer,
|
||||
quint32 line,
|
||||
quint32 column);
|
||||
|
||||
|
@@ -30,7 +30,7 @@
|
||||
#include "clangcompletionassistprocessor.h"
|
||||
#include "clangeditordocumentprocessor.h"
|
||||
|
||||
#include <cpptools/cpptoolsbridge.h>
|
||||
#include <cppeditor/cpptoolsbridge.h>
|
||||
|
||||
#include <clangsupport/clangcodemodelclientmessages.h>
|
||||
|
||||
@@ -110,13 +110,13 @@ void BackendReceiver::deleteProcessorsOfEditorWidget(TextEditor::TextEditorWidge
|
||||
m_assistProcessorsTable.remove(item);
|
||||
}
|
||||
|
||||
QFuture<CppTools::CursorInfo> BackendReceiver::addExpectedReferencesMessage(
|
||||
QFuture<CppEditor::CursorInfo> BackendReceiver::addExpectedReferencesMessage(
|
||||
quint64 ticket,
|
||||
const CppTools::SemanticInfo::LocalUseMap &localUses)
|
||||
const CppEditor::SemanticInfo::LocalUseMap &localUses)
|
||||
{
|
||||
QTC_CHECK(!m_referencesTable.contains(ticket));
|
||||
|
||||
QFutureInterface<CppTools::CursorInfo> futureInterface;
|
||||
QFutureInterface<CppEditor::CursorInfo> futureInterface;
|
||||
futureInterface.reportStarted();
|
||||
|
||||
const ReferencesEntry entry{futureInterface, localUses};
|
||||
@@ -125,11 +125,11 @@ QFuture<CppTools::CursorInfo> BackendReceiver::addExpectedReferencesMessage(
|
||||
return futureInterface.future();
|
||||
}
|
||||
|
||||
QFuture<CppTools::SymbolInfo> BackendReceiver::addExpectedRequestFollowSymbolMessage(quint64 ticket)
|
||||
QFuture<CppEditor::SymbolInfo> BackendReceiver::addExpectedRequestFollowSymbolMessage(quint64 ticket)
|
||||
{
|
||||
QTC_CHECK(!m_followTable.contains(ticket));
|
||||
|
||||
QFutureInterface<CppTools::SymbolInfo> futureInterface;
|
||||
QFutureInterface<CppEditor::SymbolInfo> futureInterface;
|
||||
futureInterface.reportStarted();
|
||||
|
||||
m_followTable.insert(ticket, futureInterface);
|
||||
@@ -137,11 +137,11 @@ QFuture<CppTools::SymbolInfo> BackendReceiver::addExpectedRequestFollowSymbolMes
|
||||
return futureInterface.future();
|
||||
}
|
||||
|
||||
QFuture<CppTools::ToolTipInfo> BackendReceiver::addExpectedToolTipMessage(quint64 ticket)
|
||||
QFuture<CppEditor::ToolTipInfo> BackendReceiver::addExpectedToolTipMessage(quint64 ticket)
|
||||
{
|
||||
QTC_CHECK(!m_toolTipsTable.contains(ticket));
|
||||
|
||||
QFutureInterface<CppTools::ToolTipInfo> futureInterface;
|
||||
QFutureInterface<CppEditor::ToolTipInfo> futureInterface;
|
||||
futureInterface.reportStarted();
|
||||
|
||||
m_toolTipsTable.insert(ticket, futureInterface);
|
||||
@@ -167,12 +167,12 @@ void BackendReceiver::reset()
|
||||
entry.futureInterface.reportFinished();
|
||||
}
|
||||
m_referencesTable.clear();
|
||||
for (QFutureInterface<CppTools::SymbolInfo> &futureInterface : m_followTable) {
|
||||
for (QFutureInterface<CppEditor::SymbolInfo> &futureInterface : m_followTable) {
|
||||
futureInterface.cancel();
|
||||
futureInterface.reportFinished();
|
||||
}
|
||||
m_followTable.clear();
|
||||
for (QFutureInterface<CppTools::ToolTipInfo> &futureInterface : m_toolTipsTable) {
|
||||
for (QFutureInterface<CppEditor::ToolTipInfo> &futureInterface : m_toolTipsTable) {
|
||||
futureInterface.cancel();
|
||||
futureInterface.reportFinished();
|
||||
}
|
||||
@@ -228,7 +228,7 @@ void BackendReceiver::annotations(const ClangBackEnd::AnnotationsMessage &messag
|
||||
}
|
||||
|
||||
static
|
||||
CppTools::CursorInfo::Range toCursorInfoRange(const ClangBackEnd::SourceRangeContainer &sourceRange)
|
||||
CppEditor::CursorInfo::Range toCursorInfoRange(const ClangBackEnd::SourceRangeContainer &sourceRange)
|
||||
{
|
||||
const ClangBackEnd::SourceLocationContainer &start = sourceRange.start;
|
||||
const ClangBackEnd::SourceLocationContainer &end = sourceRange.end;
|
||||
@@ -238,10 +238,10 @@ CppTools::CursorInfo::Range toCursorInfoRange(const ClangBackEnd::SourceRangeCon
|
||||
}
|
||||
|
||||
static
|
||||
CppTools::CursorInfo toCursorInfo(const CppTools::SemanticInfo::LocalUseMap &localUses,
|
||||
CppEditor::CursorInfo toCursorInfo(const CppEditor::SemanticInfo::LocalUseMap &localUses,
|
||||
const ClangBackEnd::ReferencesMessage &message)
|
||||
{
|
||||
CppTools::CursorInfo result;
|
||||
CppEditor::CursorInfo result;
|
||||
const QVector<ClangBackEnd::SourceRangeContainer> &references = message.references;
|
||||
|
||||
result.areUseRangesForLocalVariable = message.isLocalVariable;
|
||||
@@ -255,9 +255,9 @@ CppTools::CursorInfo toCursorInfo(const CppTools::SemanticInfo::LocalUseMap &loc
|
||||
}
|
||||
|
||||
static
|
||||
CppTools::SymbolInfo toSymbolInfo(const ClangBackEnd::FollowSymbolMessage &message)
|
||||
CppEditor::SymbolInfo toSymbolInfo(const ClangBackEnd::FollowSymbolMessage &message)
|
||||
{
|
||||
CppTools::SymbolInfo result;
|
||||
CppEditor::SymbolInfo result;
|
||||
const ClangBackEnd::SourceRangeContainer &range = message.result.range;
|
||||
|
||||
const ClangBackEnd::SourceLocationContainer &start = range.start;
|
||||
@@ -280,8 +280,8 @@ void BackendReceiver::references(const ClangBackEnd::ReferencesMessage &message)
|
||||
|
||||
const quint64 ticket = message.ticketNumber;
|
||||
const ReferencesEntry entry = m_referencesTable.take(ticket);
|
||||
QFutureInterface<CppTools::CursorInfo> futureInterface = entry.futureInterface;
|
||||
QTC_CHECK(futureInterface != QFutureInterface<CppTools::CursorInfo>());
|
||||
QFutureInterface<CppEditor::CursorInfo> futureInterface = entry.futureInterface;
|
||||
QTC_CHECK(futureInterface != QFutureInterface<CppEditor::CursorInfo>());
|
||||
|
||||
if (futureInterface.isCanceled())
|
||||
return; // Editor document closed or a new request was issued making this result outdated.
|
||||
@@ -323,9 +323,9 @@ static QStringList toStringList(const Utf8StringVector &utf8StringVector)
|
||||
return list;
|
||||
}
|
||||
|
||||
static CppTools::ToolTipInfo toToolTipInfo(const ClangBackEnd::ToolTipMessage &message)
|
||||
static CppEditor::ToolTipInfo toToolTipInfo(const ClangBackEnd::ToolTipMessage &message)
|
||||
{
|
||||
CppTools::ToolTipInfo info;
|
||||
CppEditor::ToolTipInfo info;
|
||||
|
||||
const ClangBackEnd::ToolTipInfo &backendInfo = message.toolTipInfo;
|
||||
|
||||
@@ -346,8 +346,8 @@ void BackendReceiver::tooltip(const ClangBackEnd::ToolTipMessage &message)
|
||||
qCDebugIpc() << "ToolTipMessage" << message.toolTipInfo.text;
|
||||
|
||||
const quint64 ticket = message.ticketNumber;
|
||||
QFutureInterface<CppTools::ToolTipInfo> futureInterface = m_toolTipsTable.take(ticket);
|
||||
QTC_CHECK(futureInterface != QFutureInterface<CppTools::ToolTipInfo>());
|
||||
QFutureInterface<CppEditor::ToolTipInfo> futureInterface = m_toolTipsTable.take(ticket);
|
||||
QTC_CHECK(futureInterface != QFutureInterface<CppEditor::ToolTipInfo>());
|
||||
|
||||
if (futureInterface.isCanceled())
|
||||
return; // A new request was issued making this one outdated.
|
||||
@@ -362,8 +362,8 @@ void BackendReceiver::followSymbol(const ClangBackEnd::FollowSymbolMessage &mess
|
||||
<< message.result;
|
||||
|
||||
const quint64 ticket = message.ticketNumber;
|
||||
QFutureInterface<CppTools::SymbolInfo> futureInterface = m_followTable.take(ticket);
|
||||
QTC_CHECK(futureInterface != QFutureInterface<CppTools::SymbolInfo>());
|
||||
QFutureInterface<CppEditor::SymbolInfo> futureInterface = m_followTable.take(ticket);
|
||||
QTC_CHECK(futureInterface != QFutureInterface<CppEditor::SymbolInfo>());
|
||||
|
||||
if (futureInterface.isCanceled())
|
||||
return; // Editor document closed or a new request was issued making this result outdated.
|
||||
|
@@ -25,9 +25,9 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <cpptools/cppcursorinfo.h>
|
||||
#include <cpptools/cppsymbolinfo.h>
|
||||
#include <cpptools/baseeditordocumentprocessor.h>
|
||||
#include <cppeditor/cppcursorinfo.h>
|
||||
#include <cppeditor/cppsymbolinfo.h>
|
||||
#include <cppeditor/baseeditordocumentprocessor.h>
|
||||
|
||||
#include <clangsupport/clangcodemodelclientinterface.h>
|
||||
|
||||
@@ -58,12 +58,12 @@ public:
|
||||
void cancelProcessor(TextEditor::IAssistProcessor *processor);
|
||||
void deleteProcessorsOfEditorWidget(TextEditor::TextEditorWidget *textEditorWidget);
|
||||
|
||||
QFuture<CppTools::CursorInfo>
|
||||
QFuture<CppEditor::CursorInfo>
|
||||
addExpectedReferencesMessage(quint64 ticket,
|
||||
const CppTools::SemanticInfo::LocalUseMap &localUses
|
||||
= CppTools::SemanticInfo::LocalUseMap());
|
||||
QFuture<CppTools::SymbolInfo> addExpectedRequestFollowSymbolMessage(quint64 ticket);
|
||||
QFuture<CppTools::ToolTipInfo> addExpectedToolTipMessage(quint64 ticket);
|
||||
const CppEditor::SemanticInfo::LocalUseMap &localUses
|
||||
= CppEditor::SemanticInfo::LocalUseMap());
|
||||
QFuture<CppEditor::SymbolInfo> addExpectedRequestFollowSymbolMessage(quint64 ticket);
|
||||
QFuture<CppEditor::ToolTipInfo> addExpectedToolTipMessage(quint64 ticket);
|
||||
bool isExpectingCompletionsMessage() const;
|
||||
|
||||
void reset();
|
||||
@@ -84,16 +84,16 @@ private:
|
||||
|
||||
struct ReferencesEntry {
|
||||
ReferencesEntry() = default;
|
||||
ReferencesEntry(QFutureInterface<CppTools::CursorInfo> futureInterface,
|
||||
const CppTools::SemanticInfo::LocalUseMap &localUses)
|
||||
ReferencesEntry(QFutureInterface<CppEditor::CursorInfo> futureInterface,
|
||||
const CppEditor::SemanticInfo::LocalUseMap &localUses)
|
||||
: futureInterface(futureInterface)
|
||||
, localUses(localUses) {}
|
||||
QFutureInterface<CppTools::CursorInfo> futureInterface;
|
||||
CppTools::SemanticInfo::LocalUseMap localUses;
|
||||
QFutureInterface<CppEditor::CursorInfo> futureInterface;
|
||||
CppEditor::SemanticInfo::LocalUseMap localUses;
|
||||
};
|
||||
QHash<quint64, ReferencesEntry> m_referencesTable;
|
||||
QHash<quint64, QFutureInterface<CppTools::ToolTipInfo>> m_toolTipsTable;
|
||||
QHash<quint64, QFutureInterface<CppTools::SymbolInfo>> m_followTable;
|
||||
QHash<quint64, QFutureInterface<CppEditor::ToolTipInfo>> m_toolTipsTable;
|
||||
QHash<quint64, QFutureInterface<CppEditor::SymbolInfo>> m_followTable;
|
||||
};
|
||||
|
||||
} // namespace Internal
|
||||
|
@@ -5,15 +5,15 @@ QtcPlugin {
|
||||
name: "ClangCodeModel"
|
||||
|
||||
Depends { name: "Qt"; submodules: ["concurrent", "widgets"] }
|
||||
|
||||
Depends { name: "ClangSupport" }
|
||||
Depends { name: "Core" }
|
||||
Depends { name: "CppTools" }
|
||||
Depends { name: "CppEditor" }
|
||||
Depends { name: "LanguageClient" }
|
||||
Depends { name: "ProjectExplorer" }
|
||||
Depends { name: "QtSupport"; condition: qtc.testsEnabled }
|
||||
Depends { name: "TextEditor" }
|
||||
Depends { name: "Utils" }
|
||||
Depends { name: "ClangSupport" }
|
||||
Depends { name: "LanguageClient" }
|
||||
Depends { name: "CppEditor" }
|
||||
|
||||
Depends { name: "libclang"; required: false }
|
||||
Depends { name: "clang_defines" }
|
||||
|
@@ -5,7 +5,6 @@ QTC_LIB_DEPENDS += \
|
||||
QTC_PLUGIN_DEPENDS += \
|
||||
coreplugin \
|
||||
cppeditor \
|
||||
cpptools \
|
||||
languageclient \
|
||||
texteditor
|
||||
QTC_TEST_DEPENDS += \
|
||||
|
@@ -40,7 +40,7 @@
|
||||
#include <coreplugin/messagemanager.h>
|
||||
#include <coreplugin/progressmanager/progressmanager.h>
|
||||
|
||||
#include <cpptools/cppmodelmanager.h>
|
||||
#include <cppeditor/cppmodelmanager.h>
|
||||
|
||||
#include <projectexplorer/buildconfiguration.h>
|
||||
#include <projectexplorer/projectpanelfactory.h>
|
||||
@@ -70,7 +70,7 @@ static void addProjectPanelWidget()
|
||||
|
||||
void ClangCodeModelPlugin::generateCompilationDB()
|
||||
{
|
||||
using namespace CppTools;
|
||||
using namespace CppEditor;
|
||||
|
||||
ProjectExplorer::Target *target = ProjectExplorer::SessionManager::startupTarget();
|
||||
if (!target)
|
||||
@@ -91,7 +91,7 @@ void ClangCodeModelPlugin::generateCompilationDB()
|
||||
|
||||
static bool isDBGenerationEnabled(ProjectExplorer::Project *project)
|
||||
{
|
||||
using namespace CppTools;
|
||||
using namespace CppEditor;
|
||||
if (!project)
|
||||
return false;
|
||||
const ProjectInfo::ConstPtr projectInfo = CppModelManager::instance()->projectInfo(project);
|
||||
@@ -116,7 +116,7 @@ bool ClangCodeModelPlugin::initialize(const QStringList &arguments, QString *err
|
||||
this,
|
||||
&ClangCodeModelPlugin::maybeHandleBatchFileAndExit);
|
||||
|
||||
CppTools::CppModelManager::instance()->activateClangCodeModel(&m_modelManagerSupportProvider);
|
||||
CppEditor::CppModelManager::instance()->activateClangCodeModel(&m_modelManagerSupportProvider);
|
||||
|
||||
addProjectPanelWidget();
|
||||
|
||||
@@ -167,7 +167,7 @@ void ClangCodeModelPlugin::createCompilationDBButton()
|
||||
m_generateCompilationDBAction->setEnabled(false);
|
||||
generateCompilationDB();
|
||||
});
|
||||
connect(CppTools::CppModelManager::instance(), &CppTools::CppModelManager::projectPartsUpdated,
|
||||
connect(CppEditor::CppModelManager::instance(), &CppEditor::CppModelManager::projectPartsUpdated,
|
||||
this, [this](ProjectExplorer::Project *project) {
|
||||
if (project != ProjectExplorer::SessionManager::startupProject())
|
||||
return;
|
||||
|
@@ -34,10 +34,10 @@
|
||||
#include "clangcompletionchunkstotextconverter.h"
|
||||
#include "clangpreprocessorassistproposalitem.h"
|
||||
|
||||
#include <cpptools/cppdoxygen.h>
|
||||
#include <cpptools/cppmodelmanager.h>
|
||||
#include <cpptools/cpptoolsbridge.h>
|
||||
#include <cpptools/editordocumenthandle.h>
|
||||
#include <cppeditor/cppdoxygen.h>
|
||||
#include <cppeditor/cppmodelmanager.h>
|
||||
#include <cppeditor/cpptoolsbridge.h>
|
||||
#include <cppeditor/editordocumenthandle.h>
|
||||
|
||||
#include <texteditor/codeassist/assistproposalitem.h>
|
||||
#include <texteditor/codeassist/functionhintproposal.h>
|
||||
@@ -136,7 +136,7 @@ QList<AssistProposalItemInterface *> ClangCompletionAssistProcessor::toAssistPro
|
||||
if (m_position != -1 && Utils::anyOf(completions, [](const CodeCompletion &c) {
|
||||
return c.completionKind == CodeCompletion::SignalCompletionKind;
|
||||
})) {
|
||||
considerOnlySignals = CppTools::CppModelManager::instance()
|
||||
considerOnlySignals = CppEditor::CppModelManager::instance()
|
||||
->positionRequiresSignal(m_interface->filePath().toString(), m_content, m_position);
|
||||
}
|
||||
for (const CodeCompletion &codeCompletion : completions) {
|
||||
@@ -582,8 +582,8 @@ bool ClangCompletionAssistProcessor::completePreprocessorDirectives()
|
||||
|
||||
bool ClangCompletionAssistProcessor::completeDoxygenKeywords()
|
||||
{
|
||||
for (int i = 1; i < CppTools::T_DOXY_LAST_TAG; ++i)
|
||||
addCompletionItem(QString::fromLatin1(CppTools::doxygenTagSpell(i)), CPlusPlus::Icons::keywordIcon());
|
||||
for (int i = 1; i < CppEditor::T_DOXY_LAST_TAG; ++i)
|
||||
addCompletionItem(QString::fromLatin1(CppEditor::doxygenTagSpell(i)), CPlusPlus::Icons::keywordIcon());
|
||||
return !m_completions.isEmpty();
|
||||
}
|
||||
|
||||
@@ -627,7 +627,7 @@ namespace {
|
||||
bool shouldSendDocumentForCompletion(const QString &filePath,
|
||||
int completionPosition)
|
||||
{
|
||||
CppTools::CppEditorDocumentHandle *document = cppDocument(filePath);
|
||||
CppEditor::CppEditorDocumentHandle *document = cppDocument(filePath);
|
||||
|
||||
if (document) {
|
||||
auto &sendTracker = document->sendTracker();
|
||||
@@ -641,7 +641,7 @@ bool shouldSendDocumentForCompletion(const QString &filePath,
|
||||
bool shouldSendCodeCompletion(const QString &filePath,
|
||||
int completionPosition)
|
||||
{
|
||||
CppTools::CppEditorDocumentHandle *document = cppDocument(filePath);
|
||||
CppEditor::CppEditorDocumentHandle *document = cppDocument(filePath);
|
||||
|
||||
if (document) {
|
||||
auto &sendTracker = document->sendTracker();
|
||||
@@ -653,7 +653,7 @@ bool shouldSendCodeCompletion(const QString &filePath,
|
||||
|
||||
void setLastDocumentRevision(const QString &filePath)
|
||||
{
|
||||
CppTools::CppEditorDocumentHandle *document = cppDocument(filePath);
|
||||
CppEditor::CppEditorDocumentHandle *document = cppDocument(filePath);
|
||||
|
||||
if (document)
|
||||
document->sendTracker().setLastSentRevision(int(document->revision()));
|
||||
@@ -662,7 +662,7 @@ void setLastDocumentRevision(const QString &filePath)
|
||||
void setLastCompletionPosition(const QString &filePath,
|
||||
int completionPosition)
|
||||
{
|
||||
CppTools::CppEditorDocumentHandle *document = cppDocument(filePath);
|
||||
CppEditor::CppEditorDocumentHandle *document = cppDocument(filePath);
|
||||
|
||||
if (document)
|
||||
document->sendTracker().setLastCompletionPosition(completionPosition);
|
||||
@@ -709,7 +709,7 @@ bool ClangCompletionAssistProcessor::sendCompletionRequest(int position,
|
||||
if (m_sentRequestType == NormalCompletion) {
|
||||
if (!customFileContent.isEmpty())
|
||||
m_content = customFileContent;
|
||||
else if (const CppTools::CppEditorDocumentHandle * const doc = cppDocument(filePath))
|
||||
else if (const CppEditor::CppEditorDocumentHandle * const doc = cppDocument(filePath))
|
||||
m_content = doc->contents();
|
||||
m_position = position;
|
||||
}
|
||||
|
@@ -27,7 +27,7 @@
|
||||
|
||||
#include "clangcompletionassistinterface.h"
|
||||
|
||||
#include <cpptools/cppcompletionassistprocessor.h>
|
||||
#include <cppeditor/cppcompletionassistprocessor.h>
|
||||
|
||||
#include <clangsupport/codecompletion.h>
|
||||
|
||||
@@ -40,7 +40,7 @@ namespace Internal {
|
||||
using ClangBackEnd::CodeCompletions;
|
||||
using ClangBackEnd::CompletionCorrection;
|
||||
|
||||
class ClangCompletionAssistProcessor : public CppTools::CppCompletionAssistProcessor
|
||||
class ClangCompletionAssistProcessor : public CppEditor::CppCompletionAssistProcessor
|
||||
{
|
||||
Q_DECLARE_TR_FUNCTIONS(ClangCodeModel::Internal::ClangCompletionAssistProcessor)
|
||||
|
||||
|
@@ -30,8 +30,8 @@
|
||||
#include "clangutils.h"
|
||||
|
||||
#include <cplusplus/Token.h>
|
||||
#include <cpptools/cppcompletionassistprocessor.h>
|
||||
#include <cpptools/projectpart.h>
|
||||
#include <cppeditor/cppcompletionassistprocessor.h>
|
||||
#include <cppeditor/projectpart.h>
|
||||
|
||||
#include <texteditor/codeassist/assistinterface.h>
|
||||
#include <texteditor/codeassist/iassistprocessor.h>
|
||||
@@ -66,7 +66,7 @@ TextEditor::AssistInterface *ClangCompletionAssistProvider::createAssistInterfac
|
||||
int position,
|
||||
TextEditor::AssistReason reason) const
|
||||
{
|
||||
const CppTools::ProjectPart::ConstPtr projectPart = projectPartForFileBasedOnProcessor(
|
||||
const CppEditor::ProjectPart::ConstPtr projectPart = projectPartForFileBasedOnProcessor(
|
||||
filePath.toString());
|
||||
if (projectPart) {
|
||||
return new ClangCompletionAssistInterface(m_communicator,
|
||||
|
@@ -28,14 +28,14 @@
|
||||
#include "clangbackendcommunicator.h"
|
||||
#include "clangcompletionassistinterface.h"
|
||||
|
||||
#include <cpptools/cppcompletionassistprovider.h>
|
||||
#include <cppeditor/cppcompletionassistprovider.h>
|
||||
|
||||
#include <texteditor/codeassist/assistinterface.h>
|
||||
|
||||
namespace ClangCodeModel {
|
||||
namespace Internal {
|
||||
|
||||
class ClangCompletionAssistProvider : public CppTools::CppCompletionAssistProvider
|
||||
class ClangCompletionAssistProvider : public CppEditor::CppCompletionAssistProvider
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
|
@@ -35,7 +35,7 @@
|
||||
|
||||
#include <cplusplus/Icons.h>
|
||||
|
||||
#include <cpptools/cpptoolsconstants.h>
|
||||
#include <cppeditor/cppeditorconstants.h>
|
||||
|
||||
#include <texteditor/textdocument.h>
|
||||
|
||||
@@ -54,8 +54,8 @@ namespace Internal {
|
||||
|
||||
ClangCurrentDocumentFilter::ClangCurrentDocumentFilter()
|
||||
{
|
||||
setId(CppTools::Constants::CURRENT_DOCUMENT_FILTER_ID);
|
||||
setDisplayName(CppTools::Constants::CURRENT_DOCUMENT_FILTER_DISPLAY_NAME);
|
||||
setId(CppEditor::Constants::CURRENT_DOCUMENT_FILTER_ID);
|
||||
setDisplayName(CppEditor::Constants::CURRENT_DOCUMENT_FILTER_DISPLAY_NAME);
|
||||
setDefaultShortcutString(".");
|
||||
setPriority(High);
|
||||
setDefaultIncludedByDefault(false);
|
||||
|
@@ -39,15 +39,15 @@
|
||||
#include <cplusplus/Icons.h>
|
||||
#include <cplusplus/MatchingText.h>
|
||||
#include <cppeditor/cppeditorconstants.h>
|
||||
#include <cpptools/cppcodemodelsettings.h>
|
||||
#include <cpptools/cppdoxygen.h>
|
||||
#include <cpptools/cppeditorwidgetinterface.h>
|
||||
#include <cpptools/cppfindreferences.h>
|
||||
#include <cpptools/cppmodelmanager.h>
|
||||
#include <cpptools/cpptoolsreuse.h>
|
||||
#include <cpptools/cppvirtualfunctionassistprovider.h>
|
||||
#include <cpptools/cppvirtualfunctionproposalitem.h>
|
||||
#include <cpptools/semantichighlighter.h>
|
||||
#include <cppeditor/cppcodemodelsettings.h>
|
||||
#include <cppeditor/cppdoxygen.h>
|
||||
#include <cppeditor/cppeditorwidgetinterface.h>
|
||||
#include <cppeditor/cppfindreferences.h>
|
||||
#include <cppeditor/cppmodelmanager.h>
|
||||
#include <cppeditor/cpptoolsreuse.h>
|
||||
#include <cppeditor/cppvirtualfunctionassistprovider.h>
|
||||
#include <cppeditor/cppvirtualfunctionproposalitem.h>
|
||||
#include <cppeditor/semantichighlighter.h>
|
||||
#include <languageclient/languageclientinterface.h>
|
||||
#include <languageclient/languageclientutils.h>
|
||||
#include <projectexplorer/project.h>
|
||||
@@ -444,7 +444,7 @@ public:
|
||||
static BaseClientInterface *clientInterface(Project *project, const Utils::FilePath &jsonDbDir)
|
||||
{
|
||||
QString indexingOption = "--background-index";
|
||||
const CppTools::ClangdSettings settings(CppTools::ClangdProjectSettings(project).settings());
|
||||
const CppEditor::ClangdSettings settings(CppEditor::ClangdProjectSettings(project).settings());
|
||||
if (!settings.indexingEnabled())
|
||||
indexingOption += "=0";
|
||||
Utils::CommandLine cmd{settings.clangdFilePath(), {indexingOption, "--limit-results=0"}};
|
||||
@@ -479,7 +479,7 @@ public:
|
||||
Utils::optional<ReplacementData> replacementData;
|
||||
quint64 key;
|
||||
bool canceled = false;
|
||||
bool categorize = CppTools::codeModelSettings()->categorizeFindReferences();
|
||||
bool categorize = CppEditor::codeModelSettings()->categorizeFindReferences();
|
||||
};
|
||||
|
||||
using SymbolData = QPair<QString, Utils::Link>;
|
||||
@@ -511,7 +511,7 @@ private:
|
||||
|
||||
TextEditor::IAssistProposal *immediateProposalImpl() const;
|
||||
TextEditor::IAssistProposal *createProposal(bool final) const;
|
||||
CppTools::VirtualFunctionProposalItem *createEntry(const QString &name,
|
||||
CppEditor::VirtualFunctionProposalItem *createEntry(const QString &name,
|
||||
const Utils::Link &link) const;
|
||||
|
||||
ClangdClient::Private *m_data = nullptr;
|
||||
@@ -532,7 +532,7 @@ private:
|
||||
class ClangdClient::FollowSymbolData {
|
||||
public:
|
||||
FollowSymbolData(ClangdClient *q, quint64 id, const QTextCursor &cursor,
|
||||
CppTools::CppEditorWidgetInterface *editorWidget,
|
||||
CppEditor::CppEditorWidgetInterface *editorWidget,
|
||||
const DocumentUri &uri, Utils::ProcessLinkCallback &&callback,
|
||||
bool openInSplit)
|
||||
: q(q), id(id), cursor(cursor), editorWidget(editorWidget), uri(uri),
|
||||
@@ -565,7 +565,7 @@ public:
|
||||
{
|
||||
return Utils::anyOf(EditorManager::visibleEditors(), [this](IEditor *editor) {
|
||||
const auto textEditor = qobject_cast<TextEditor::BaseTextEditor *>(editor);
|
||||
return textEditor && dynamic_cast<CppTools::CppEditorWidgetInterface *>(
|
||||
return textEditor && dynamic_cast<CppEditor::CppEditorWidgetInterface *>(
|
||||
textEditor->editorWidget()) == editorWidget;
|
||||
});
|
||||
}
|
||||
@@ -573,7 +573,7 @@ public:
|
||||
ClangdClient * const q;
|
||||
const quint64 id;
|
||||
const QTextCursor cursor;
|
||||
CppTools::CppEditorWidgetInterface * const editorWidget;
|
||||
CppEditor::CppEditorWidgetInterface * const editorWidget;
|
||||
const DocumentUri uri;
|
||||
const Utils::ProcessLinkCallback callback;
|
||||
VirtualFunctionAssistProvider virtualFuncAssistProvider;
|
||||
@@ -596,7 +596,7 @@ public:
|
||||
class SwitchDeclDefData {
|
||||
public:
|
||||
SwitchDeclDefData(quint64 id, TextEditor::TextDocument *doc, const QTextCursor &cursor,
|
||||
CppTools::CppEditorWidgetInterface *editorWidget,
|
||||
CppEditor::CppEditorWidgetInterface *editorWidget,
|
||||
Utils::ProcessLinkCallback &&callback)
|
||||
: id(id), document(doc), uri(DocumentUri::fromFilePath(doc->filePath())),
|
||||
cursor(cursor), editorWidget(editorWidget), callback(std::move(callback)) {}
|
||||
@@ -639,7 +639,7 @@ public:
|
||||
const QPointer<TextEditor::TextDocument> document;
|
||||
const DocumentUri uri;
|
||||
const QTextCursor cursor;
|
||||
CppTools::CppEditorWidgetInterface * const editorWidget;
|
||||
CppEditor::CppEditorWidgetInterface * const editorWidget;
|
||||
Utils::ProcessLinkCallback callback;
|
||||
Utils::optional<DocumentSymbolsResult> docSymbols;
|
||||
Utils::optional<AstNode> ast;
|
||||
@@ -648,7 +648,7 @@ public:
|
||||
class LocalRefsData {
|
||||
public:
|
||||
LocalRefsData(quint64 id, TextEditor::TextDocument *doc, const QTextCursor &cursor,
|
||||
CppTools::RefactoringEngineInterface::RenameCallback &&callback)
|
||||
CppEditor::RefactoringEngineInterface::RenameCallback &&callback)
|
||||
: id(id), document(doc), cursor(cursor), callback(std::move(callback)),
|
||||
uri(DocumentUri::fromFilePath(doc->filePath())), revision(doc->document()->revision())
|
||||
{}
|
||||
@@ -662,7 +662,7 @@ public:
|
||||
const quint64 id;
|
||||
const QPointer<TextEditor::TextDocument> document;
|
||||
const QTextCursor cursor;
|
||||
CppTools::RefactoringEngineInterface::RenameCallback callback;
|
||||
CppEditor::RefactoringEngineInterface::RenameCallback callback;
|
||||
const DocumentUri uri;
|
||||
const int revision;
|
||||
};
|
||||
@@ -696,9 +696,9 @@ private:
|
||||
TextEditor::IAssistProposal *perform(const TextEditor::AssistInterface *) override
|
||||
{
|
||||
QList<TextEditor::AssistProposalItemInterface *> completions;
|
||||
for (int i = 1; i < CppTools::T_DOXY_LAST_TAG; ++i) {
|
||||
for (int i = 1; i < CppEditor::T_DOXY_LAST_TAG; ++i) {
|
||||
const auto item = new ClangPreprocessorAssistProposalItem;
|
||||
item->setText(QLatin1String(CppTools::doxygenTagSpell(i)));
|
||||
item->setText(QLatin1String(CppEditor::doxygenTagSpell(i)));
|
||||
item->setIcon(CPlusPlus::Icons::keywordIcon());
|
||||
item->setCompletionOperator(m_completionOperator);
|
||||
completions.append(item);
|
||||
@@ -745,7 +745,7 @@ class ClangdClient::Private
|
||||
{
|
||||
public:
|
||||
Private(ClangdClient *q, Project *project)
|
||||
: q(q), settings(CppTools::ClangdProjectSettings(project).settings()) {}
|
||||
: q(q), settings(CppEditor::ClangdProjectSettings(project).settings()) {}
|
||||
|
||||
void findUsages(TextEditor::TextDocument *document, const QTextCursor &cursor,
|
||||
const QString &searchTerm, const Utils::optional<QString> &replacement);
|
||||
@@ -781,14 +781,14 @@ public:
|
||||
QChar typedChar);
|
||||
|
||||
ClangdClient * const q;
|
||||
const CppTools::ClangdSettings::Data settings;
|
||||
const CppEditor::ClangdSettings::Data settings;
|
||||
DoxygenAssistProvider doxygenAssistProvider;
|
||||
QHash<quint64, ReferencesData> runningFindUsages;
|
||||
Utils::optional<FollowSymbolData> followSymbolData;
|
||||
Utils::optional<SwitchDeclDefData> switchDeclDefData;
|
||||
Utils::optional<LocalRefsData> localRefsData;
|
||||
Utils::optional<QVersionNumber> versionNumber;
|
||||
std::unordered_map<TextEditor::TextDocument *, CppTools::SemanticHighlighter> highlighters;
|
||||
std::unordered_map<TextEditor::TextDocument *, CppEditor::SemanticHighlighter> highlighters;
|
||||
quint64 nextJobId = 0;
|
||||
bool isFullyIndexed = false;
|
||||
bool isTesting = false;
|
||||
@@ -816,7 +816,7 @@ ClangdClient::ClangdClient(Project *project, const Utils::FilePath &jsonDbDir)
|
||||
if (!project) {
|
||||
QJsonObject initOptions;
|
||||
const QStringList clangOptions = createClangOptions(
|
||||
*CppTools::CppModelManager::instance()->fallbackProjectPart(), {},
|
||||
*CppEditor::CppModelManager::instance()->fallbackProjectPart(), {},
|
||||
warningsConfigForProject(nullptr), optionsForProject(nullptr));
|
||||
initOptions.insert("fallbackFlags", QJsonArray::fromStringList(clangOptions));
|
||||
setInitializationOptions(initOptions);
|
||||
@@ -901,7 +901,7 @@ ClangdClient::ClangdClient(Project *project, const Utils::FilePath &jsonDbDir)
|
||||
docText = Utils::get<MarkupContent>(*doc).content();
|
||||
return docText.contains("Annotation: qt_signal");
|
||||
};
|
||||
if (pos != -1 && Utils::anyOf(items, criterion) && CppTools::CppModelManager::instance()
|
||||
if (pos != -1 && Utils::anyOf(items, criterion) && CppEditor::CppModelManager::instance()
|
||||
->positionRequiresSignal(filePath.toString(), content.toUtf8(), pos)) {
|
||||
return Utils::filtered(items, criterion);
|
||||
}
|
||||
@@ -1045,7 +1045,7 @@ QVersionNumber ClangdClient::versionNumber() const
|
||||
return d->versionNumber.value();
|
||||
}
|
||||
|
||||
CppTools::ClangdSettings::Data ClangdClient::settingsData() const { return d->settings; }
|
||||
CppEditor::ClangdSettings::Data ClangdClient::settingsData() const { return d->settings; }
|
||||
|
||||
void ClangdClient::Private::findUsages(TextEditor::TextDocument *document,
|
||||
const QTextCursor &cursor, const QString &searchTerm,
|
||||
@@ -1070,7 +1070,7 @@ void ClangdClient::Private::findUsages(TextEditor::TextDocument *document,
|
||||
SearchResultWindow::PreserveCaseDisabled,
|
||||
"CppEditor");
|
||||
if (refData.categorize)
|
||||
refData.search->setFilter(new CppTools::CppSearchResultFilter);
|
||||
refData.search->setFilter(new CppEditor::CppSearchResultFilter);
|
||||
if (refData.replacementData) {
|
||||
refData.search->setTextToReplace(refData.replacementData->newSymbolName);
|
||||
const auto renameFilesCheckBox = new QCheckBox;
|
||||
@@ -1274,7 +1274,7 @@ void ClangdClient::Private::handleRenameRequest(const SearchResult *search,
|
||||
fileNodes << node;
|
||||
}
|
||||
if (!fileNodes.isEmpty())
|
||||
CppTools::renameFilesForSymbol(replacementData.oldSymbolName, newSymbolName, fileNodes);
|
||||
CppEditor::renameFilesForSymbol(replacementData.oldSymbolName, newSymbolName, fileNodes);
|
||||
}
|
||||
|
||||
void ClangdClient::Private::addSearchResultsForFile(ReferencesData &refData,
|
||||
@@ -1290,7 +1290,7 @@ void ClangdClient::Private::addSearchResultsForFile(ReferencesData &refData,
|
||||
: Usage::Type::Other;
|
||||
SearchResultItem item;
|
||||
item.setUserData(int(usageType));
|
||||
item.setStyle(CppTools::colorStyleForUsageType(usageType));
|
||||
item.setStyle(CppEditor::colorStyleForUsageType(usageType));
|
||||
item.setFilePath(file);
|
||||
item.setMainRange(SymbolSupport::convertRange(range));
|
||||
item.setUseTextEditorFont(true);
|
||||
@@ -1345,7 +1345,7 @@ void ClangdClient::Private::finishSearch(const ReferencesData &refData, bool can
|
||||
void ClangdClient::followSymbol(
|
||||
TextEditor::TextDocument *document,
|
||||
const QTextCursor &cursor,
|
||||
CppTools::CppEditorWidgetInterface *editorWidget,
|
||||
CppEditor::CppEditorWidgetInterface *editorWidget,
|
||||
Utils::ProcessLinkCallback &&callback,
|
||||
bool resolveTarget,
|
||||
bool openInSplit
|
||||
@@ -1405,7 +1405,7 @@ void ClangdClient::followSymbol(
|
||||
}
|
||||
|
||||
void ClangdClient::switchDeclDef(TextEditor::TextDocument *document, const QTextCursor &cursor,
|
||||
CppTools::CppEditorWidgetInterface *editorWidget,
|
||||
CppEditor::CppEditorWidgetInterface *editorWidget,
|
||||
Utils::ProcessLinkCallback &&callback)
|
||||
{
|
||||
QTC_ASSERT(documentOpen(document), openDocument(document));
|
||||
@@ -1441,7 +1441,7 @@ void ClangdClient::switchDeclDef(TextEditor::TextDocument *document, const QText
|
||||
}
|
||||
|
||||
void ClangdClient::findLocalUsages(TextEditor::TextDocument *document, const QTextCursor &cursor,
|
||||
CppTools::RefactoringEngineInterface::RenameCallback &&callback)
|
||||
CppEditor::RefactoringEngineInterface::RenameCallback &&callback)
|
||||
{
|
||||
QTC_ASSERT(documentOpen(document), openDocument(document));
|
||||
|
||||
@@ -2091,10 +2091,10 @@ static void collectExtraResults(QFutureInterface<TextEditor::HighlightingResult>
|
||||
result.textStyles.mixinStyles.push_back(TextEditor::C_OPERATOR);
|
||||
Utils::Text::convertPosition(doc, absQuestionMarkPos, &result.line, &result.column);
|
||||
result.length = 1;
|
||||
result.kind = CppTools::SemanticHighlighter::TernaryIf;
|
||||
result.kind = CppEditor::SemanticHighlighter::TernaryIf;
|
||||
insert(result);
|
||||
Utils::Text::convertPosition(doc, absColonPos, &result.line, &result.column);
|
||||
result.kind = CppTools::SemanticHighlighter::TernaryElse;
|
||||
result.kind = CppEditor::SemanticHighlighter::TernaryElse;
|
||||
insert(result);
|
||||
continue;
|
||||
}
|
||||
@@ -2129,11 +2129,11 @@ static void collectExtraResults(QFutureInterface<TextEditor::HighlightingResult>
|
||||
Utils::Text::convertPosition(doc, absOpeningAngleBracketPos,
|
||||
&result.line, &result.column);
|
||||
result.length = 1;
|
||||
result.kind = CppTools::SemanticHighlighter::AngleBracketOpen;
|
||||
result.kind = CppEditor::SemanticHighlighter::AngleBracketOpen;
|
||||
insert(result);
|
||||
Utils::Text::convertPosition(doc, absClosingAngleBracketPos,
|
||||
&result.line, &result.column);
|
||||
result.kind = CppTools::SemanticHighlighter::AngleBracketClose;
|
||||
result.kind = CppEditor::SemanticHighlighter::AngleBracketClose;
|
||||
insert(result);
|
||||
};
|
||||
|
||||
@@ -2793,22 +2793,22 @@ TextEditor::IAssistProposal *ClangdClient::VirtualFunctionAssistProcessor::creat
|
||||
if (needsBaseDeclEntry)
|
||||
items << createEntry({}, m_data->followSymbolData->defLink);
|
||||
if (!final) {
|
||||
const auto infoItem = new CppTools::VirtualFunctionProposalItem({}, false);
|
||||
const auto infoItem = new CppEditor::VirtualFunctionProposalItem({}, false);
|
||||
infoItem->setText(ClangdClient::tr("collecting overrides ..."));
|
||||
infoItem->setOrder(-1);
|
||||
items << infoItem;
|
||||
}
|
||||
|
||||
return new CppTools::VirtualFunctionProposal(
|
||||
return new CppEditor::VirtualFunctionProposal(
|
||||
m_data->followSymbolData->cursor.position(),
|
||||
items, m_data->followSymbolData->openInSplit);
|
||||
}
|
||||
|
||||
CppTools::VirtualFunctionProposalItem *
|
||||
CppEditor::VirtualFunctionProposalItem *
|
||||
ClangdClient::VirtualFunctionAssistProcessor::createEntry(const QString &name,
|
||||
const Utils::Link &link) const
|
||||
{
|
||||
const auto item = new CppTools::VirtualFunctionProposalItem(
|
||||
const auto item = new CppEditor::VirtualFunctionProposalItem(
|
||||
link, m_data->followSymbolData->openInSplit);
|
||||
QString text = name;
|
||||
if (link == m_data->followSymbolData->defLink) {
|
||||
|
@@ -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,
|
||||
|
@@ -25,7 +25,7 @@
|
||||
|
||||
#include "clangdiagnosticfilter.h"
|
||||
|
||||
#include <cpptools/cppprojectfile.h>
|
||||
#include <cppeditor/cppprojectfile.h>
|
||||
|
||||
#include <utf8stringvector.h>
|
||||
|
||||
@@ -106,7 +106,7 @@ namespace Internal {
|
||||
void ClangDiagnosticFilter::filterDocumentRelatedWarnings(
|
||||
const QVector<ClangBackEnd::DiagnosticContainer> &diagnostics)
|
||||
{
|
||||
using namespace CppTools;
|
||||
using namespace CppEditor;
|
||||
const bool isHeaderFile = ProjectFile::isHeader(ProjectFile::classify(m_filePath));
|
||||
|
||||
const auto isLocalWarning = [this, isHeaderFile]
|
||||
|
@@ -32,7 +32,7 @@
|
||||
#include <coreplugin/actionmanager/actionmanager.h>
|
||||
#include <coreplugin/actionmanager/command.h>
|
||||
|
||||
#include <cpptools/cpptoolsconstants.h>
|
||||
#include <cppeditor/cppeditorconstants.h>
|
||||
|
||||
#include <projectexplorer/taskhub.h>
|
||||
|
||||
@@ -247,7 +247,7 @@ TextEditor::RefactorMarker createFixItAvailableMarker(QTextDocument *textDocumen
|
||||
editor->invokeAssist(TextEditor::QuickFix);
|
||||
}
|
||||
};
|
||||
marker.type = CppTools::Constants::CPP_CLANG_FIXIT_AVAILABLE_MARKER_ID;
|
||||
marker.type = CppEditor::Constants::CPP_CLANG_FIXIT_AVAILABLE_MARKER_ID;
|
||||
|
||||
return marker;
|
||||
}
|
||||
|
@@ -31,7 +31,7 @@
|
||||
|
||||
#include <coreplugin/editormanager/editormanager.h>
|
||||
|
||||
#include <cpptools/cpptoolsconstants.h>
|
||||
#include <cppeditor/cppeditorconstants.h>
|
||||
|
||||
#include <utils/qtcassert.h>
|
||||
#include <utils/tooltip/tooltip.h>
|
||||
|
@@ -25,12 +25,12 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <cpptools/baseeditordocumentparser.h>
|
||||
#include <cppeditor/baseeditordocumentparser.h>
|
||||
|
||||
namespace ClangCodeModel {
|
||||
namespace Internal {
|
||||
|
||||
class ClangEditorDocumentParser : public CppTools::BaseEditorDocumentParser
|
||||
class ClangEditorDocumentParser : public CppEditor::BaseEditorDocumentParser
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
|
@@ -37,15 +37,15 @@
|
||||
#include <diagnosticcontainer.h>
|
||||
#include <sourcelocationcontainer.h>
|
||||
|
||||
#include <cpptools/builtincursorinfo.h>
|
||||
#include <cpptools/clangdiagnosticconfigsmodel.h>
|
||||
#include <cpptools/compileroptionsbuilder.h>
|
||||
#include <cpptools/cppcodemodelsettings.h>
|
||||
#include <cpptools/cppmodelmanager.h>
|
||||
#include <cpptools/cpptoolsbridge.h>
|
||||
#include <cpptools/cpptoolsreuse.h>
|
||||
#include <cpptools/cppworkingcopy.h>
|
||||
#include <cpptools/editordocumenthandle.h>
|
||||
#include <cppeditor/builtincursorinfo.h>
|
||||
#include <cppeditor/clangdiagnosticconfigsmodel.h>
|
||||
#include <cppeditor/compileroptionsbuilder.h>
|
||||
#include <cppeditor/cppcodemodelsettings.h>
|
||||
#include <cppeditor/cppmodelmanager.h>
|
||||
#include <cppeditor/cpptoolsbridge.h>
|
||||
#include <cppeditor/cpptoolsreuse.h>
|
||||
#include <cppeditor/cppworkingcopy.h>
|
||||
#include <cppeditor/editordocumenthandle.h>
|
||||
|
||||
#include <texteditor/fontsettings.h>
|
||||
#include <texteditor/texteditor.h>
|
||||
@@ -88,9 +88,9 @@ ClangEditorDocumentProcessor::ClangEditorDocumentProcessor(
|
||||
|
||||
// Forwarding the semantic info from the builtin processor enables us to provide all
|
||||
// editor (widget) related features that are not yet implemented by the clang plugin.
|
||||
connect(&m_builtinProcessor, &CppTools::BuiltinEditorDocumentProcessor::cppDocumentUpdated,
|
||||
connect(&m_builtinProcessor, &CppEditor::BuiltinEditorDocumentProcessor::cppDocumentUpdated,
|
||||
this, &ClangEditorDocumentProcessor::cppDocumentUpdated);
|
||||
connect(&m_builtinProcessor, &CppTools::BuiltinEditorDocumentProcessor::semanticInfoUpdated,
|
||||
connect(&m_builtinProcessor, &CppEditor::BuiltinEditorDocumentProcessor::semanticInfoUpdated,
|
||||
this, &ClangEditorDocumentProcessor::semanticInfoUpdated);
|
||||
|
||||
m_parserSynchronizer.setCancelOnWait(true);
|
||||
@@ -105,7 +105,7 @@ ClangEditorDocumentProcessor::~ClangEditorDocumentProcessor()
|
||||
}
|
||||
|
||||
void ClangEditorDocumentProcessor::runImpl(
|
||||
const CppTools::BaseEditorDocumentParser::UpdateParams &updateParams)
|
||||
const CppEditor::BaseEditorDocumentParser::UpdateParams &updateParams)
|
||||
{
|
||||
m_updateBackendDocumentTimer.start();
|
||||
|
||||
@@ -146,12 +146,12 @@ void ClangEditorDocumentProcessor::semanticRehighlight()
|
||||
requestAnnotationsFromBackend();
|
||||
}
|
||||
|
||||
CppTools::SemanticInfo ClangEditorDocumentProcessor::recalculateSemanticInfo()
|
||||
CppEditor::SemanticInfo ClangEditorDocumentProcessor::recalculateSemanticInfo()
|
||||
{
|
||||
return m_builtinProcessor.recalculateSemanticInfo();
|
||||
}
|
||||
|
||||
CppTools::BaseEditorDocumentParser::Ptr ClangEditorDocumentProcessor::parser()
|
||||
CppEditor::BaseEditorDocumentParser::Ptr ClangEditorDocumentProcessor::parser()
|
||||
{
|
||||
return m_parser;
|
||||
}
|
||||
@@ -171,7 +171,7 @@ bool ClangEditorDocumentProcessor::hasProjectPart() const
|
||||
return !m_projectPart.isNull();
|
||||
}
|
||||
|
||||
CppTools::ProjectPart::ConstPtr ClangEditorDocumentProcessor::projectPart() const
|
||||
CppEditor::ProjectPart::ConstPtr ClangEditorDocumentProcessor::projectPart() const
|
||||
{
|
||||
return m_projectPart;
|
||||
}
|
||||
@@ -326,7 +326,7 @@ TextEditor::TextMarks ClangEditorDocumentProcessor::diagnosticTextMarksAt(uint l
|
||||
}
|
||||
|
||||
void ClangEditorDocumentProcessor::setParserConfig(
|
||||
const CppTools::BaseEditorDocumentParser::Configuration &config)
|
||||
const CppEditor::BaseEditorDocumentParser::Configuration &config)
|
||||
{
|
||||
m_parser->setConfiguration(config);
|
||||
m_builtinProcessor.parser()->setConfiguration(config);
|
||||
@@ -335,13 +335,13 @@ void ClangEditorDocumentProcessor::setParserConfig(
|
||||
static bool isCursorOnIdentifier(const QTextCursor &textCursor)
|
||||
{
|
||||
QTextDocument *document = textCursor.document();
|
||||
return CppTools::isValidIdentifierChar(document->characterAt(textCursor.position()));
|
||||
return CppEditor::isValidIdentifierChar(document->characterAt(textCursor.position()));
|
||||
}
|
||||
|
||||
static QFuture<CppTools::CursorInfo> defaultCursorInfoFuture()
|
||||
static QFuture<CppEditor::CursorInfo> defaultCursorInfoFuture()
|
||||
{
|
||||
QFutureInterface<CppTools::CursorInfo> futureInterface;
|
||||
futureInterface.reportResult(CppTools::CursorInfo());
|
||||
QFutureInterface<CppEditor::CursorInfo> futureInterface;
|
||||
futureInterface.reportResult(CppEditor::CursorInfo());
|
||||
futureInterface.reportFinished();
|
||||
|
||||
return futureInterface.future();
|
||||
@@ -357,8 +357,8 @@ static bool convertPosition(const QTextCursor &textCursor, int *line, int *colum
|
||||
return converted;
|
||||
}
|
||||
|
||||
QFuture<CppTools::CursorInfo>
|
||||
ClangEditorDocumentProcessor::cursorInfo(const CppTools::CursorInfoParams ¶ms)
|
||||
QFuture<CppEditor::CursorInfo>
|
||||
ClangEditorDocumentProcessor::cursorInfo(const CppEditor::CursorInfoParams ¶ms)
|
||||
{
|
||||
int line, column;
|
||||
convertPosition(params.textCursor, &line, &column);
|
||||
@@ -367,8 +367,8 @@ ClangEditorDocumentProcessor::cursorInfo(const CppTools::CursorInfoParams ¶m
|
||||
return defaultCursorInfoFuture();
|
||||
|
||||
column = clangColumn(params.textCursor.document()->findBlockByNumber(line - 1), column);
|
||||
const CppTools::SemanticInfo::LocalUseMap localUses
|
||||
= CppTools::BuiltinCursorInfo::findLocalUses(params.semanticInfo.doc, line, column);
|
||||
const CppEditor::SemanticInfo::LocalUseMap localUses
|
||||
= CppEditor::BuiltinCursorInfo::findLocalUses(params.semanticInfo.doc, line, column);
|
||||
|
||||
return m_communicator.requestReferences(simpleFileContainer(),
|
||||
static_cast<quint32>(line),
|
||||
@@ -376,7 +376,7 @@ ClangEditorDocumentProcessor::cursorInfo(const CppTools::CursorInfoParams ¶m
|
||||
localUses);
|
||||
}
|
||||
|
||||
QFuture<CppTools::CursorInfo> ClangEditorDocumentProcessor::requestLocalReferences(
|
||||
QFuture<CppEditor::CursorInfo> ClangEditorDocumentProcessor::requestLocalReferences(
|
||||
const QTextCursor &cursor)
|
||||
{
|
||||
int line, column;
|
||||
@@ -392,7 +392,7 @@ QFuture<CppTools::CursorInfo> ClangEditorDocumentProcessor::requestLocalReferenc
|
||||
static_cast<quint32>(column));
|
||||
}
|
||||
|
||||
QFuture<CppTools::SymbolInfo>
|
||||
QFuture<CppEditor::SymbolInfo>
|
||||
ClangEditorDocumentProcessor::requestFollowSymbol(int line, int column)
|
||||
{
|
||||
return m_communicator.requestFollowSymbol(simpleFileContainer(),
|
||||
@@ -400,7 +400,7 @@ ClangEditorDocumentProcessor::requestFollowSymbol(int line, int column)
|
||||
static_cast<quint32>(column));
|
||||
}
|
||||
|
||||
QFuture<CppTools::ToolTipInfo> ClangEditorDocumentProcessor::toolTipInfo(const QByteArray &codecName,
|
||||
QFuture<CppEditor::ToolTipInfo> ClangEditorDocumentProcessor::toolTipInfo(const QByteArray &codecName,
|
||||
int line,
|
||||
int column)
|
||||
{
|
||||
@@ -416,12 +416,12 @@ void ClangEditorDocumentProcessor::clearDiagnosticsWithFixIts()
|
||||
|
||||
ClangEditorDocumentProcessor *ClangEditorDocumentProcessor::get(const QString &filePath)
|
||||
{
|
||||
auto *processor = CppTools::CppToolsBridge::baseEditorDocumentProcessor(filePath);
|
||||
auto *processor = CppEditor::CppToolsBridge::baseEditorDocumentProcessor(filePath);
|
||||
|
||||
return qobject_cast<ClangEditorDocumentProcessor*>(processor);
|
||||
}
|
||||
|
||||
static bool isProjectPartLoadedOrIsFallback(CppTools::ProjectPart::ConstPtr projectPart)
|
||||
static bool isProjectPartLoadedOrIsFallback(CppEditor::ProjectPart::ConstPtr projectPart)
|
||||
{
|
||||
return projectPart
|
||||
&& (projectPart->id().isEmpty() || isProjectPartLoaded(projectPart));
|
||||
@@ -429,14 +429,14 @@ static bool isProjectPartLoadedOrIsFallback(CppTools::ProjectPart::ConstPtr proj
|
||||
|
||||
void ClangEditorDocumentProcessor::updateBackendProjectPartAndDocument()
|
||||
{
|
||||
const CppTools::ProjectPart::ConstPtr projectPart = m_parser->projectPartInfo().projectPart;
|
||||
const CppEditor::ProjectPart::ConstPtr projectPart = m_parser->projectPartInfo().projectPart;
|
||||
|
||||
if (isProjectPartLoadedOrIsFallback(projectPart)) {
|
||||
updateBackendDocument(*projectPart.data());
|
||||
|
||||
m_projectPart = projectPart;
|
||||
m_isProjectFile = m_parser->projectPartInfo().hints
|
||||
& CppTools::ProjectPartInfo::IsFromProjectMatch;
|
||||
& CppEditor::ProjectPartInfo::IsFromProjectMatch;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -448,7 +448,7 @@ void ClangEditorDocumentProcessor::onParserFinished()
|
||||
updateBackendProjectPartAndDocument();
|
||||
}
|
||||
|
||||
void ClangEditorDocumentProcessor::updateBackendDocument(const CppTools::ProjectPart &projectPart)
|
||||
void ClangEditorDocumentProcessor::updateBackendDocument(const CppEditor::ProjectPart &projectPart)
|
||||
{
|
||||
// On registration we send the document content immediately as an unsaved
|
||||
// file, because
|
||||
@@ -464,8 +464,8 @@ void ClangEditorDocumentProcessor::updateBackendDocument(const CppTools::Project
|
||||
return;
|
||||
}
|
||||
|
||||
ProjectExplorer::Project * const project = CppTools::projectForProjectPart(projectPart);
|
||||
const CppTools::ClangDiagnosticConfig config = warningsConfigForProject(project);
|
||||
ProjectExplorer::Project * const project = CppEditor::projectForProjectPart(projectPart);
|
||||
const CppEditor::ClangDiagnosticConfig config = warningsConfigForProject(project);
|
||||
const QStringList clangOptions = createClangOptions(projectPart, filePath(), config,
|
||||
optionsForProject(project));
|
||||
m_diagnosticConfigId = config.id();
|
||||
@@ -495,12 +495,12 @@ void ClangEditorDocumentProcessor::requestAnnotationsFromBackend()
|
||||
m_communicator.requestAnnotations(fileContainer);
|
||||
}
|
||||
|
||||
CppTools::BaseEditorDocumentProcessor::HeaderErrorDiagnosticWidgetCreator
|
||||
CppEditor::BaseEditorDocumentProcessor::HeaderErrorDiagnosticWidgetCreator
|
||||
ClangEditorDocumentProcessor::creatorForHeaderErrorDiagnosticWidget(
|
||||
const ClangBackEnd::DiagnosticContainer &firstHeaderErrorDiagnostic)
|
||||
{
|
||||
if (firstHeaderErrorDiagnostic.text.isEmpty())
|
||||
return CppTools::BaseEditorDocumentProcessor::HeaderErrorDiagnosticWidgetCreator();
|
||||
return CppEditor::BaseEditorDocumentProcessor::HeaderErrorDiagnosticWidgetCreator();
|
||||
|
||||
return [firstHeaderErrorDiagnostic]() {
|
||||
auto vbox = new QVBoxLayout;
|
||||
|
@@ -28,8 +28,8 @@
|
||||
#include "clangdiagnosticmanager.h"
|
||||
#include "clangeditordocumentparser.h"
|
||||
|
||||
#include <cpptools/builtineditordocumentprocessor.h>
|
||||
#include <cpptools/semantichighlighter.h>
|
||||
#include <cppeditor/builtineditordocumentprocessor.h>
|
||||
#include <cppeditor/semantichighlighter.h>
|
||||
|
||||
#include <utils/futuresynchronizer.h>
|
||||
#include <utils/id.h>
|
||||
@@ -48,7 +48,7 @@ namespace Internal {
|
||||
|
||||
class BackendCommunicator;
|
||||
|
||||
class ClangEditorDocumentProcessor : public CppTools::BaseEditorDocumentProcessor
|
||||
class ClangEditorDocumentProcessor : public CppEditor::BaseEditorDocumentProcessor
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
@@ -58,16 +58,16 @@ public:
|
||||
~ClangEditorDocumentProcessor() override;
|
||||
|
||||
// BaseEditorDocumentProcessor interface
|
||||
void runImpl(const CppTools::BaseEditorDocumentParser::UpdateParams &updateParams) override;
|
||||
void runImpl(const CppEditor::BaseEditorDocumentParser::UpdateParams &updateParams) override;
|
||||
void semanticRehighlight() override;
|
||||
void recalculateSemanticInfoDetached(bool force) override;
|
||||
CppTools::SemanticInfo recalculateSemanticInfo() override;
|
||||
CppTools::BaseEditorDocumentParser::Ptr parser() override;
|
||||
CppEditor::SemanticInfo recalculateSemanticInfo() override;
|
||||
CppEditor::BaseEditorDocumentParser::Ptr parser() override;
|
||||
CPlusPlus::Snapshot snapshot() override;
|
||||
bool isParserRunning() const override;
|
||||
|
||||
bool hasProjectPart() const;
|
||||
CppTools::ProjectPart::ConstPtr projectPart() const;
|
||||
CppEditor::ProjectPart::ConstPtr projectPart() const;
|
||||
void clearProjectPart();
|
||||
|
||||
::Utils::Id diagnosticConfigId() const;
|
||||
@@ -90,12 +90,12 @@ public:
|
||||
|
||||
void editorDocumentTimerRestarted() override;
|
||||
|
||||
void setParserConfig(const CppTools::BaseEditorDocumentParser::Configuration &config) override;
|
||||
void setParserConfig(const CppEditor::BaseEditorDocumentParser::Configuration &config) override;
|
||||
|
||||
QFuture<CppTools::CursorInfo> cursorInfo(const CppTools::CursorInfoParams ¶ms) override;
|
||||
QFuture<CppTools::CursorInfo> requestLocalReferences(const QTextCursor &cursor) override;
|
||||
QFuture<CppTools::SymbolInfo> requestFollowSymbol(int line, int column) override;
|
||||
QFuture<CppTools::ToolTipInfo> toolTipInfo(const QByteArray &codecName,
|
||||
QFuture<CppEditor::CursorInfo> cursorInfo(const CppEditor::CursorInfoParams ¶ms) override;
|
||||
QFuture<CppEditor::CursorInfo> requestLocalReferences(const QTextCursor &cursor) override;
|
||||
QFuture<CppEditor::SymbolInfo> requestFollowSymbol(int line, int column) override;
|
||||
QFuture<CppEditor::ToolTipInfo> toolTipInfo(const QByteArray &codecName,
|
||||
int line,
|
||||
int column) override;
|
||||
|
||||
@@ -120,7 +120,7 @@ private:
|
||||
void onParserFinished();
|
||||
|
||||
void updateBackendProjectPartAndDocument();
|
||||
void updateBackendDocument(const CppTools::ProjectPart &projectPart);
|
||||
void updateBackendDocument(const CppEditor::ProjectPart &projectPart);
|
||||
void updateBackendDocumentIfProjectPartExists();
|
||||
void requestAnnotationsFromBackend();
|
||||
|
||||
@@ -137,7 +137,7 @@ private:
|
||||
ClangDiagnosticManager m_diagnosticManager;
|
||||
BackendCommunicator &m_communicator;
|
||||
QSharedPointer<ClangEditorDocumentParser> m_parser;
|
||||
CppTools::ProjectPart::ConstPtr m_projectPart;
|
||||
CppEditor::ProjectPart::ConstPtr m_projectPart;
|
||||
::Utils::Id m_diagnosticConfigId;
|
||||
bool m_isProjectFile = false;
|
||||
QFutureWatcher<void> m_parserWatcher;
|
||||
@@ -146,8 +146,8 @@ private:
|
||||
enum class InvalidationState { Off, Scheduled, Canceled } m_invalidationState;
|
||||
|
||||
QVector<ClangBackEnd::TokenInfoContainer> m_tokenInfos;
|
||||
CppTools::SemanticHighlighter m_semanticHighlighter;
|
||||
CppTools::BuiltinEditorDocumentProcessor m_builtinProcessor;
|
||||
CppEditor::SemanticHighlighter m_semanticHighlighter;
|
||||
CppEditor::BuiltinEditorDocumentProcessor m_builtinProcessor;
|
||||
Utils::FutureSynchronizer m_parserSynchronizer;
|
||||
};
|
||||
|
||||
|
@@ -30,8 +30,8 @@
|
||||
#include "clangmodelmanagersupport.h"
|
||||
|
||||
#include <coreplugin/editormanager/editormanager.h>
|
||||
#include <cpptools/cppmodelmanager.h>
|
||||
#include <cpptools/cppfollowsymbolundercursor.h>
|
||||
#include <cppeditor/cppmodelmanager.h>
|
||||
#include <cppeditor/cppfollowsymbolundercursor.h>
|
||||
#include <texteditor/texteditor.h>
|
||||
|
||||
#include <clangsupport/tokeninfocontainer.h>
|
||||
@@ -150,7 +150,7 @@ static Utils::Link linkAtCursor(const QTextCursor &cursor,
|
||||
}
|
||||
|
||||
static ::Utils::ProcessLinkCallback extendedCallback(::Utils::ProcessLinkCallback &&callback,
|
||||
const CppTools::SymbolInfo &result)
|
||||
const CppEditor::SymbolInfo &result)
|
||||
{
|
||||
// If globalFollowSymbol finds nothing follow to the declaration.
|
||||
return [original_callback = std::move(callback), result](const ::Utils::Link &link) {
|
||||
@@ -169,12 +169,12 @@ static bool isSameInvocationContext(const Utils::FilePath &filePath)
|
||||
&& Core::EditorManager::currentDocument()->filePath() == filePath;
|
||||
}
|
||||
|
||||
void ClangFollowSymbol::findLink(const CppTools::CursorInEditor &data,
|
||||
void ClangFollowSymbol::findLink(const CppEditor::CursorInEditor &data,
|
||||
::Utils::ProcessLinkCallback &&processLinkCallback,
|
||||
bool resolveTarget,
|
||||
const CPlusPlus::Snapshot &snapshot,
|
||||
const CPlusPlus::Document::Ptr &documentFromSemanticInfo,
|
||||
CppTools::SymbolFinder *symbolFinder,
|
||||
CppEditor::SymbolFinder *symbolFinder,
|
||||
bool inNextSplit)
|
||||
{
|
||||
ClangdClient * const client
|
||||
@@ -202,7 +202,7 @@ void ClangFollowSymbol::findLink(const CppTools::CursorInEditor &data,
|
||||
static_cast<uint>(column),
|
||||
processor);
|
||||
if (link == Utils::Link()) {
|
||||
CppTools::FollowSymbolUnderCursor followSymbol;
|
||||
CppEditor::FollowSymbolUnderCursor followSymbol;
|
||||
return followSymbol.findLink(data,
|
||||
std::move(processLinkCallback),
|
||||
false,
|
||||
@@ -214,7 +214,7 @@ void ClangFollowSymbol::findLink(const CppTools::CursorInEditor &data,
|
||||
return processLinkCallback(link);
|
||||
}
|
||||
|
||||
QFuture<CppTools::SymbolInfo> infoFuture
|
||||
QFuture<CppEditor::SymbolInfo> infoFuture
|
||||
= processor->requestFollowSymbol(static_cast<int>(line),
|
||||
static_cast<int>(column));
|
||||
|
||||
@@ -230,11 +230,11 @@ void ClangFollowSymbol::findLink(const CppTools::CursorInEditor &data,
|
||||
callback=std::move(processLinkCallback)]() mutable {
|
||||
if (m_watcher->isCanceled() || !isSameInvocationContext(filePath))
|
||||
return callback(Utils::Link());
|
||||
CppTools::SymbolInfo result = m_watcher->result();
|
||||
CppEditor::SymbolInfo result = m_watcher->result();
|
||||
// We did not fail but the result is empty
|
||||
if (result.fileName.isEmpty() || result.isResultOnlyForFallBack) {
|
||||
const CppTools::RefactoringEngineInterface &refactoringEngine
|
||||
= *CppTools::CppModelManager::instance();
|
||||
const CppEditor::RefactoringEngineInterface &refactoringEngine
|
||||
= *CppEditor::CppModelManager::instance();
|
||||
refactoringEngine.globalFollowSymbol(data,
|
||||
extendedCallback(std::move(callback), result),
|
||||
snapshot,
|
||||
@@ -251,11 +251,11 @@ void ClangFollowSymbol::findLink(const CppTools::CursorInEditor &data,
|
||||
m_watcher->setFuture(infoFuture);
|
||||
}
|
||||
|
||||
void ClangFollowSymbol::switchDeclDef(const CppTools::CursorInEditor &data,
|
||||
void ClangFollowSymbol::switchDeclDef(const CppEditor::CursorInEditor &data,
|
||||
Utils::ProcessLinkCallback &&processLinkCallback,
|
||||
const CPlusPlus::Snapshot &snapshot,
|
||||
const CPlusPlus::Document::Ptr &documentFromSemanticInfo,
|
||||
CppTools::SymbolFinder *symbolFinder)
|
||||
CppEditor::SymbolFinder *symbolFinder)
|
||||
{
|
||||
ClangdClient * const client
|
||||
= ClangModelManagerSupport::instance()->clientForFile(data.filePath());
|
||||
@@ -264,7 +264,7 @@ void ClangFollowSymbol::switchDeclDef(const CppTools::CursorInEditor &data,
|
||||
std::move(processLinkCallback));
|
||||
return;
|
||||
}
|
||||
CppTools::CppModelManager::builtinFollowSymbol().switchDeclDef(
|
||||
CppEditor::CppModelManager::builtinFollowSymbol().switchDeclDef(
|
||||
data, std::move(processLinkCallback), snapshot, documentFromSemanticInfo,
|
||||
symbolFinder);
|
||||
}
|
||||
|
@@ -25,33 +25,33 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <cpptools/followsymbolinterface.h>
|
||||
#include <cpptools/cppsymbolinfo.h>
|
||||
#include <cppeditor/followsymbolinterface.h>
|
||||
#include <cppeditor/cppsymbolinfo.h>
|
||||
|
||||
#include <QFutureWatcher>
|
||||
|
||||
namespace ClangCodeModel {
|
||||
namespace Internal {
|
||||
|
||||
class ClangFollowSymbol : public CppTools::FollowSymbolInterface
|
||||
class ClangFollowSymbol : public CppEditor::FollowSymbolInterface
|
||||
{
|
||||
public:
|
||||
void findLink(const CppTools::CursorInEditor &data,
|
||||
void findLink(const CppEditor::CursorInEditor &data,
|
||||
::Utils::ProcessLinkCallback &&processLinkCallback,
|
||||
bool resolveTarget,
|
||||
const CPlusPlus::Snapshot &snapshot,
|
||||
const CPlusPlus::Document::Ptr &documentFromSemanticInfo,
|
||||
CppTools::SymbolFinder *symbolFinder,
|
||||
CppEditor::SymbolFinder *symbolFinder,
|
||||
bool inNextSplit) override;
|
||||
|
||||
void switchDeclDef(const CppTools::CursorInEditor &data,
|
||||
void switchDeclDef(const CppEditor::CursorInEditor &data,
|
||||
Utils::ProcessLinkCallback &&processLinkCallback,
|
||||
const CPlusPlus::Snapshot &snapshot,
|
||||
const CPlusPlus::Document::Ptr &documentFromSemanticInfo,
|
||||
CppTools::SymbolFinder *symbolFinder) override;
|
||||
CppEditor::SymbolFinder *symbolFinder) override;
|
||||
|
||||
private:
|
||||
using FutureSymbolWatcher = QFutureWatcher<CppTools::SymbolInfo>;
|
||||
using FutureSymbolWatcher = QFutureWatcher<CppEditor::SymbolInfo>;
|
||||
std::unique_ptr<FutureSymbolWatcher> m_watcher;
|
||||
|
||||
};
|
||||
|
@@ -28,11 +28,11 @@
|
||||
#include "clangdclient.h"
|
||||
#include "clangmodelmanagersupport.h"
|
||||
|
||||
#include <cpptools/cppclassesfilter.h>
|
||||
#include <cpptools/cppfunctionsfilter.h>
|
||||
#include <cpptools/cppmodelmanager.h>
|
||||
#include <cpptools/cpptoolsconstants.h>
|
||||
#include <cpptools/indexitem.h>
|
||||
#include <cppeditor/cppclassesfilter.h>
|
||||
#include <cppeditor/cppeditorconstants.h>
|
||||
#include <cppeditor/cppfunctionsfilter.h>
|
||||
#include <cppeditor/cppmodelmanager.h>
|
||||
#include <cppeditor/indexitem.h>
|
||||
#include <languageclient/locatorfilter.h>
|
||||
#include <projectexplorer/session.h>
|
||||
#include <utils/link.h>
|
||||
@@ -45,11 +45,11 @@ namespace Internal {
|
||||
|
||||
const int MaxResultCount = 10000;
|
||||
|
||||
class CppLocatorFilter : public CppTools::CppLocatorFilter
|
||||
class CppLocatorFilter : public CppEditor::CppLocatorFilter
|
||||
{
|
||||
public:
|
||||
CppLocatorFilter()
|
||||
: CppTools::CppLocatorFilter(CppTools::CppModelManager::instance()->locatorData())
|
||||
: CppEditor::CppLocatorFilter(CppEditor::CppModelManager::instance()->locatorData())
|
||||
{
|
||||
setId({});
|
||||
setDisplayName({});
|
||||
@@ -74,11 +74,11 @@ public:
|
||||
};
|
||||
|
||||
|
||||
class CppClassesFilter : public CppTools::CppClassesFilter
|
||||
class CppClassesFilter : public CppEditor::CppClassesFilter
|
||||
{
|
||||
public:
|
||||
CppClassesFilter()
|
||||
: CppTools::CppClassesFilter(CppTools::CppModelManager::instance()->locatorData())
|
||||
: CppEditor::CppClassesFilter(CppEditor::CppModelManager::instance()->locatorData())
|
||||
{
|
||||
setId({});
|
||||
setDisplayName({});
|
||||
@@ -101,11 +101,11 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
class CppFunctionsFilter : public CppTools::CppFunctionsFilter
|
||||
class CppFunctionsFilter : public CppEditor::CppFunctionsFilter
|
||||
{
|
||||
public:
|
||||
CppFunctionsFilter()
|
||||
: CppTools::CppFunctionsFilter(CppTools::CppModelManager::instance()->locatorData())
|
||||
: CppEditor::CppFunctionsFilter(CppEditor::CppModelManager::instance()->locatorData())
|
||||
{
|
||||
setId({});
|
||||
setDisplayName({});
|
||||
@@ -139,8 +139,8 @@ ClangGlobalSymbolFilter::ClangGlobalSymbolFilter(ILocatorFilter *cppFilter,
|
||||
ILocatorFilter *lspFilter)
|
||||
: m_cppFilter(cppFilter), m_lspFilter(lspFilter)
|
||||
{
|
||||
setId(CppTools::Constants::LOCATOR_FILTER_ID);
|
||||
setDisplayName(CppTools::Constants::LOCATOR_FILTER_DISPLAY_NAME);
|
||||
setId(CppEditor::Constants::LOCATOR_FILTER_ID);
|
||||
setDisplayName(CppEditor::Constants::LOCATOR_FILTER_DISPLAY_NAME);
|
||||
setDefaultShortcutString(":");
|
||||
setDefaultIncludedByDefault(false);
|
||||
}
|
||||
@@ -175,8 +175,8 @@ QList<Core::LocatorFilterEntry> ClangGlobalSymbolFilter::matchesFor(
|
||||
if (!lspMatches.isEmpty()) {
|
||||
std::set<std::tuple<Utils::FilePath, int, int>> locations;
|
||||
for (const auto &entry : qAsConst(matches)) {
|
||||
const CppTools::IndexItem::Ptr item
|
||||
= qvariant_cast<CppTools::IndexItem::Ptr>(entry.internalData);
|
||||
const CppEditor::IndexItem::Ptr item
|
||||
= qvariant_cast<CppEditor::IndexItem::Ptr>(entry.internalData);
|
||||
locations.insert(std::make_tuple(Utils::FilePath::fromString(item->fileName()),
|
||||
item->line(),
|
||||
item->column()));
|
||||
@@ -198,7 +198,7 @@ QList<Core::LocatorFilterEntry> ClangGlobalSymbolFilter::matchesFor(
|
||||
void ClangGlobalSymbolFilter::accept(Core::LocatorFilterEntry selection, QString *newText,
|
||||
int *selectionStart, int *selectionLength) const
|
||||
{
|
||||
if (qvariant_cast<CppTools::IndexItem::Ptr>(selection.internalData))
|
||||
if (qvariant_cast<CppEditor::IndexItem::Ptr>(selection.internalData))
|
||||
m_cppFilter->accept(selection, newText, selectionStart, selectionLength);
|
||||
else
|
||||
m_lspFilter->accept(selection, newText, selectionStart, selectionLength);
|
||||
@@ -208,8 +208,8 @@ void ClangGlobalSymbolFilter::accept(Core::LocatorFilterEntry selection, QString
|
||||
ClangClassesFilter::ClangClassesFilter()
|
||||
: ClangGlobalSymbolFilter(new CppClassesFilter, new LspClassesFilter)
|
||||
{
|
||||
setId(CppTools::Constants::CLASSES_FILTER_ID);
|
||||
setDisplayName(CppTools::Constants::CLASSES_FILTER_DISPLAY_NAME);
|
||||
setId(CppEditor::Constants::CLASSES_FILTER_ID);
|
||||
setDisplayName(CppEditor::Constants::CLASSES_FILTER_DISPLAY_NAME);
|
||||
setDefaultShortcutString("c");
|
||||
setDefaultIncludedByDefault(false);
|
||||
}
|
||||
@@ -217,8 +217,8 @@ ClangClassesFilter::ClangClassesFilter()
|
||||
ClangFunctionsFilter::ClangFunctionsFilter()
|
||||
: ClangGlobalSymbolFilter(new CppFunctionsFilter, new LspFunctionsFilter)
|
||||
{
|
||||
setId(CppTools::Constants::FUNCTIONS_FILTER_ID);
|
||||
setDisplayName(CppTools::Constants::FUNCTIONS_FILTER_DISPLAY_NAME);
|
||||
setId(CppEditor::Constants::FUNCTIONS_FILTER_ID);
|
||||
setDisplayName(CppEditor::Constants::FUNCTIONS_FILTER_DISPLAY_NAME);
|
||||
setDefaultShortcutString("m");
|
||||
setDefaultIncludedByDefault(false);
|
||||
}
|
||||
|
@@ -25,7 +25,7 @@
|
||||
|
||||
#include "clanghighlightingresultreporter.h"
|
||||
|
||||
#include <cpptools/semantichighlighter.h>
|
||||
#include <cppeditor/semantichighlighter.h>
|
||||
#include <texteditor/textstyles.h>
|
||||
#include <utils/qtcassert.h>
|
||||
|
||||
@@ -149,15 +149,15 @@ TextEditor::HighlightingResult toHighlightingResult(
|
||||
TextEditor::HighlightingResult result(tokenInfo.line, tokenInfo.column, tokenInfo.length,
|
||||
textStyles);
|
||||
if (tokenInfo.types.mixinHighlightingTypes.contains(HighlightingType::AngleBracketOpen))
|
||||
result.kind = CppTools::SemanticHighlighter::AngleBracketOpen;
|
||||
result.kind = CppEditor::SemanticHighlighter::AngleBracketOpen;
|
||||
else if (tokenInfo.types.mixinHighlightingTypes.contains(HighlightingType::AngleBracketClose))
|
||||
result.kind = CppTools::SemanticHighlighter::AngleBracketClose;
|
||||
result.kind = CppEditor::SemanticHighlighter::AngleBracketClose;
|
||||
else if (tokenInfo.types.mixinHighlightingTypes.contains(HighlightingType::DoubleAngleBracketClose))
|
||||
result.kind = CppTools::SemanticHighlighter::DoubleAngleBracketClose;
|
||||
result.kind = CppEditor::SemanticHighlighter::DoubleAngleBracketClose;
|
||||
else if (tokenInfo.types.mixinHighlightingTypes.contains(HighlightingType::TernaryIf))
|
||||
result.kind = CppTools::SemanticHighlighter::TernaryIf;
|
||||
result.kind = CppEditor::SemanticHighlighter::TernaryIf;
|
||||
else if (tokenInfo.types.mixinHighlightingTypes.contains(HighlightingType::TernaryElse))
|
||||
result.kind = CppTools::SemanticHighlighter::TernaryElse;
|
||||
result.kind = CppEditor::SemanticHighlighter::TernaryElse;
|
||||
return result;
|
||||
}
|
||||
|
||||
|
@@ -29,9 +29,9 @@
|
||||
#include "clangmodelmanagersupport.h"
|
||||
|
||||
#include <coreplugin/helpmanager.h>
|
||||
#include <cpptools/cppmodelmanager.h>
|
||||
#include <cpptools/cpptoolsreuse.h>
|
||||
#include <cpptools/editordocumenthandle.h>
|
||||
#include <cppeditor/cppmodelmanager.h>
|
||||
#include <cppeditor/cpptoolsreuse.h>
|
||||
#include <cppeditor/editordocumenthandle.h>
|
||||
#include <texteditor/texteditor.h>
|
||||
|
||||
#include <utils/qtcassert.h>
|
||||
@@ -51,11 +51,11 @@ using namespace TextEditor;
|
||||
namespace ClangCodeModel {
|
||||
namespace Internal {
|
||||
|
||||
static CppTools::BaseEditorDocumentProcessor *editorDocumentProcessor(TextEditorWidget *editorWidget)
|
||||
static CppEditor::BaseEditorDocumentProcessor *editorDocumentProcessor(TextEditorWidget *editorWidget)
|
||||
{
|
||||
const QString filePath = editorWidget->textDocument()->filePath().toString();
|
||||
auto cppModelManager = CppTools::CppModelManager::instance();
|
||||
CppTools::CppEditorDocumentHandle *editorHandle = cppModelManager->cppEditorDocument(filePath);
|
||||
auto cppModelManager = CppEditor::CppModelManager::instance();
|
||||
CppEditor::CppEditorDocumentHandle *editorHandle = cppModelManager->cppEditorDocument(filePath);
|
||||
|
||||
if (editorHandle)
|
||||
return editorHandle->processor();
|
||||
@@ -76,17 +76,17 @@ static TextMarks diagnosticTextMarksAt(TextEditorWidget *editorWidget, int posit
|
||||
return processor->diagnosticTextMarksAt(line, column);
|
||||
}
|
||||
|
||||
static QFuture<CppTools::ToolTipInfo> editorDocumentHandlesToolTipInfo(
|
||||
static QFuture<CppEditor::ToolTipInfo> editorDocumentHandlesToolTipInfo(
|
||||
TextEditorWidget *editorWidget, int pos)
|
||||
{
|
||||
const QByteArray textCodecName = editorWidget->textDocument()->codec()->name();
|
||||
if (CppTools::BaseEditorDocumentProcessor *processor = editorDocumentProcessor(editorWidget)) {
|
||||
if (CppEditor::BaseEditorDocumentProcessor *processor = editorDocumentProcessor(editorWidget)) {
|
||||
int line, column;
|
||||
if (Utils::Text::convertPosition(editorWidget->document(), pos, &line, &column))
|
||||
return processor->toolTipInfo(textCodecName, line, column + 1);
|
||||
}
|
||||
|
||||
return QFuture<CppTools::ToolTipInfo>();
|
||||
return QFuture<CppEditor::ToolTipInfo>();
|
||||
}
|
||||
|
||||
ClangHoverHandler::~ClangHoverHandler()
|
||||
@@ -116,21 +116,21 @@ void ClangHoverHandler::identifyMatch(TextEditorWidget *editorWidget,
|
||||
}
|
||||
|
||||
// Check for tooltips (async)
|
||||
QFuture<CppTools::ToolTipInfo> future = editorDocumentHandlesToolTipInfo(editorWidget, pos);
|
||||
QFuture<CppEditor::ToolTipInfo> future = editorDocumentHandlesToolTipInfo(editorWidget, pos);
|
||||
if (QTC_GUARD(future.isRunning())) {
|
||||
qCDebug(hoverLog) << "Requesting tooltip info at" << pos;
|
||||
m_reportPriority = report;
|
||||
m_futureWatcher.reset(new QFutureWatcher<CppTools::ToolTipInfo>());
|
||||
m_futureWatcher.reset(new QFutureWatcher<CppEditor::ToolTipInfo>());
|
||||
QTextCursor tc(editorWidget->document());
|
||||
tc.setPosition(pos);
|
||||
const QStringList fallback = CppTools::identifierWordsUnderCursor(tc);
|
||||
const QStringList fallback = CppEditor::identifierWordsUnderCursor(tc);
|
||||
QObject::connect(m_futureWatcher.data(),
|
||||
&QFutureWatcherBase::finished,
|
||||
[this, fallback]() {
|
||||
if (m_futureWatcher->isCanceled()) {
|
||||
m_reportPriority(Priority_None);
|
||||
} else {
|
||||
CppTools::ToolTipInfo info = m_futureWatcher->result();
|
||||
CppEditor::ToolTipInfo info = m_futureWatcher->result();
|
||||
qCDebug(hoverLog)
|
||||
<< "Appending word-based fallback lookup" << fallback;
|
||||
info.qDocIdCandidates += fallback;
|
||||
@@ -172,7 +172,7 @@ static const char *helpItemCategoryAsString(Core::HelpItem::Category category)
|
||||
}
|
||||
#undef RETURN_TEXT_FOR_CASE
|
||||
|
||||
void ClangHoverHandler::processToolTipInfo(const CppTools::ToolTipInfo &info)
|
||||
void ClangHoverHandler::processToolTipInfo(const CppEditor::ToolTipInfo &info)
|
||||
{
|
||||
qCDebug(hoverLog) << "Processing tooltip info" << info.text;
|
||||
|
||||
|
@@ -25,8 +25,8 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <cpptools/baseeditordocumentprocessor.h>
|
||||
#include <cpptools/cpphoverhandler.h>
|
||||
#include <cppeditor/baseeditordocumentprocessor.h>
|
||||
#include <cppeditor/cpphoverhandler.h>
|
||||
#include <texteditor/basehoverhandler.h>
|
||||
|
||||
namespace ClangCodeModel {
|
||||
@@ -46,11 +46,11 @@ public:
|
||||
|
||||
private:
|
||||
void abort() override;
|
||||
void processToolTipInfo(const CppTools::ToolTipInfo &info);
|
||||
void processToolTipInfo(const CppEditor::ToolTipInfo &info);
|
||||
|
||||
private:
|
||||
int m_cursorPosition = -1;
|
||||
QScopedPointer<QFutureWatcher<CppTools::ToolTipInfo>> m_futureWatcher;
|
||||
QScopedPointer<QFutureWatcher<CppEditor::ToolTipInfo>> m_futureWatcher;
|
||||
ReportPriority m_reportPriority;
|
||||
};
|
||||
|
||||
|
@@ -43,11 +43,11 @@
|
||||
#include <coreplugin/icore.h>
|
||||
#include <coreplugin/messagemanager.h>
|
||||
|
||||
#include <cpptools/cppcodemodelsettings.h>
|
||||
#include <cpptools/cppfollowsymbolundercursor.h>
|
||||
#include <cpptools/cppmodelmanager.h>
|
||||
#include <cpptools/cpptoolsreuse.h>
|
||||
#include <cpptools/editordocumenthandle.h>
|
||||
#include <cppeditor/cppcodemodelsettings.h>
|
||||
#include <cppeditor/cppfollowsymbolundercursor.h>
|
||||
#include <cppeditor/cppmodelmanager.h>
|
||||
#include <cppeditor/cpptoolsreuse.h>
|
||||
#include <cppeditor/editordocumenthandle.h>
|
||||
|
||||
#include <languageclient/languageclientmanager.h>
|
||||
|
||||
@@ -69,7 +69,7 @@
|
||||
#include <QTextBlock>
|
||||
#include <QTimer>
|
||||
|
||||
using namespace CppTools;
|
||||
using namespace CppEditor;
|
||||
using namespace LanguageClient;
|
||||
|
||||
namespace ClangCodeModel {
|
||||
@@ -77,9 +77,9 @@ namespace Internal {
|
||||
|
||||
static ClangModelManagerSupport *m_instance = nullptr;
|
||||
|
||||
static CppTools::CppModelManager *cppModelManager()
|
||||
static CppEditor::CppModelManager *cppModelManager()
|
||||
{
|
||||
return CppTools::CppModelManager::instance();
|
||||
return CppEditor::CppModelManager::instance();
|
||||
}
|
||||
|
||||
static const QList<TextEditor::BaseTextEditor *> allCppEditors()
|
||||
@@ -91,7 +91,7 @@ static const QList<TextEditor::BaseTextEditor *> allCppEditors()
|
||||
continue;
|
||||
if (const auto cppEditor = qobject_cast<TextEditor::BaseTextEditor *>(Utils::findOrDefault(
|
||||
Core::DocumentModel::editorsForDocument(textDocument), [](Core::IEditor *editor) {
|
||||
return CppTools::CppModelManager::isCppEditor(editor);
|
||||
return CppEditor::CppModelManager::isCppEditor(editor);
|
||||
}))) {
|
||||
cppEditors << cppEditor;
|
||||
}
|
||||
@@ -108,7 +108,7 @@ ClangModelManagerSupport::ClangModelManagerSupport()
|
||||
QTC_CHECK(!m_instance);
|
||||
m_instance = this;
|
||||
|
||||
CppTools::CppModelManager::instance()->setCurrentDocumentFilter(
|
||||
CppEditor::CppModelManager::instance()->setCurrentDocumentFilter(
|
||||
std::make_unique<ClangCurrentDocumentFilter>());
|
||||
cppModelManager()->setLocatorFilter(std::make_unique<ClangGlobalSymbolFilter>());
|
||||
cppModelManager()->setClassesFilter(std::make_unique<ClangClassesFilter>());
|
||||
@@ -122,14 +122,14 @@ ClangModelManagerSupport::ClangModelManagerSupport()
|
||||
connect(editorManager, &Core::EditorManager::editorsClosed,
|
||||
this, &ClangModelManagerSupport::onEditorClosed);
|
||||
|
||||
CppTools::CppModelManager *modelManager = cppModelManager();
|
||||
connect(modelManager, &CppTools::CppModelManager::abstractEditorSupportContentsUpdated,
|
||||
CppEditor::CppModelManager *modelManager = cppModelManager();
|
||||
connect(modelManager, &CppEditor::CppModelManager::abstractEditorSupportContentsUpdated,
|
||||
this, &ClangModelManagerSupport::onAbstractEditorSupportContentsUpdated);
|
||||
connect(modelManager, &CppTools::CppModelManager::abstractEditorSupportRemoved,
|
||||
connect(modelManager, &CppEditor::CppModelManager::abstractEditorSupportRemoved,
|
||||
this, &ClangModelManagerSupport::onAbstractEditorSupportRemoved);
|
||||
connect(modelManager, &CppTools::CppModelManager::projectPartsUpdated,
|
||||
connect(modelManager, &CppEditor::CppModelManager::projectPartsUpdated,
|
||||
this, &ClangModelManagerSupport::onProjectPartsUpdated);
|
||||
connect(modelManager, &CppTools::CppModelManager::projectPartsRemoved,
|
||||
connect(modelManager, &CppEditor::CppModelManager::projectPartsRemoved,
|
||||
this, &ClangModelManagerSupport::onProjectPartsRemoved);
|
||||
|
||||
auto *sessionManager = ProjectExplorer::SessionManager::instance();
|
||||
@@ -143,14 +143,14 @@ ClangModelManagerSupport::ClangModelManagerSupport()
|
||||
claimNonProjectSources(fallbackClient);
|
||||
});
|
||||
|
||||
CppTools::ClangdSettings::setDefaultClangdPath(Core::ICore::clangdExecutable(CLANG_BINDIR));
|
||||
connect(&CppTools::ClangdSettings::instance(), &CppTools::ClangdSettings::changed,
|
||||
CppEditor::ClangdSettings::setDefaultClangdPath(Core::ICore::clangdExecutable(CLANG_BINDIR));
|
||||
connect(&CppEditor::ClangdSettings::instance(), &CppEditor::ClangdSettings::changed,
|
||||
this, &ClangModelManagerSupport::onClangdSettingsChanged);
|
||||
CppTools::CppCodeModelSettings *settings = CppTools::codeModelSettings();
|
||||
connect(settings, &CppTools::CppCodeModelSettings::clangDiagnosticConfigsInvalidated,
|
||||
CppEditor::CppCodeModelSettings *settings = CppEditor::codeModelSettings();
|
||||
connect(settings, &CppEditor::CppCodeModelSettings::clangDiagnosticConfigsInvalidated,
|
||||
this, &ClangModelManagerSupport::onDiagnosticConfigsInvalidated);
|
||||
|
||||
if (CppTools::ClangdSettings::instance().useClangd())
|
||||
if (CppEditor::ClangdSettings::instance().useClangd())
|
||||
createClient(nullptr, {});
|
||||
|
||||
m_generatorSynchronizer.setCancelOnWait(true);
|
||||
@@ -164,12 +164,12 @@ ClangModelManagerSupport::~ClangModelManagerSupport()
|
||||
m_instance = nullptr;
|
||||
}
|
||||
|
||||
CppTools::CppCompletionAssistProvider *ClangModelManagerSupport::completionAssistProvider()
|
||||
CppEditor::CppCompletionAssistProvider *ClangModelManagerSupport::completionAssistProvider()
|
||||
{
|
||||
return &m_completionAssistProvider;
|
||||
}
|
||||
|
||||
CppTools::CppCompletionAssistProvider *ClangModelManagerSupport::functionHintAssistProvider()
|
||||
CppEditor::CppCompletionAssistProvider *ClangModelManagerSupport::functionHintAssistProvider()
|
||||
{
|
||||
return &m_functionHintAssistProvider;
|
||||
}
|
||||
@@ -179,17 +179,17 @@ TextEditor::BaseHoverHandler *ClangModelManagerSupport::createHoverHandler()
|
||||
return new Internal::ClangHoverHandler;
|
||||
}
|
||||
|
||||
CppTools::FollowSymbolInterface &ClangModelManagerSupport::followSymbolInterface()
|
||||
CppEditor::FollowSymbolInterface &ClangModelManagerSupport::followSymbolInterface()
|
||||
{
|
||||
return *m_followSymbol;
|
||||
}
|
||||
|
||||
CppTools::RefactoringEngineInterface &ClangModelManagerSupport::refactoringEngineInterface()
|
||||
CppEditor::RefactoringEngineInterface &ClangModelManagerSupport::refactoringEngineInterface()
|
||||
{
|
||||
return *m_refactoringEngine;
|
||||
}
|
||||
|
||||
std::unique_ptr<CppTools::AbstractOverviewModel> ClangModelManagerSupport::createOverviewModel()
|
||||
std::unique_ptr<CppEditor::AbstractOverviewModel> ClangModelManagerSupport::createOverviewModel()
|
||||
{
|
||||
return std::make_unique<OverviewModel>();
|
||||
}
|
||||
@@ -199,7 +199,7 @@ bool ClangModelManagerSupport::supportsOutline(const TextEditor::TextDocument *d
|
||||
return !clientForFile(document->filePath());
|
||||
}
|
||||
|
||||
CppTools::BaseEditorDocumentProcessor *ClangModelManagerSupport::createEditorDocumentProcessor(
|
||||
CppEditor::BaseEditorDocumentProcessor *ClangModelManagerSupport::createEditorDocumentProcessor(
|
||||
TextEditor::TextDocument *baseTextDocument)
|
||||
{
|
||||
return new ClangEditorDocumentProcessor(m_communicator, baseTextDocument);
|
||||
@@ -275,9 +275,9 @@ void ClangModelManagerSupport::connectToWidgetsMarkContextMenuRequested(QWidget
|
||||
}
|
||||
|
||||
void ClangModelManagerSupport::updateLanguageClient(
|
||||
ProjectExplorer::Project *project, const CppTools::ProjectInfo::ConstPtr &projectInfo)
|
||||
ProjectExplorer::Project *project, const CppEditor::ProjectInfo::ConstPtr &projectInfo)
|
||||
{
|
||||
if (!CppTools::ClangdProjectSettings(project).settings().useClangd)
|
||||
if (!CppEditor::ClangdProjectSettings(project).settings().useClangd)
|
||||
return;
|
||||
const auto getJsonDbDir = [project] {
|
||||
if (const ProjectExplorer::Target * const target = project->activeTarget()) {
|
||||
@@ -298,9 +298,9 @@ void ClangModelManagerSupport::updateLanguageClient(
|
||||
generatorWatcher->deleteLater();
|
||||
if (!ProjectExplorer::SessionManager::hasProject(project))
|
||||
return;
|
||||
if (!CppTools::ClangdProjectSettings(project).settings().useClangd)
|
||||
if (!CppEditor::ClangdProjectSettings(project).settings().useClangd)
|
||||
return;
|
||||
const CppTools::ProjectInfo::ConstPtr newProjectInfo
|
||||
const CppEditor::ProjectInfo::ConstPtr newProjectInfo
|
||||
= cppModelManager()->projectInfo(project);
|
||||
if (!newProjectInfo || *newProjectInfo != *projectInfo)
|
||||
return;
|
||||
@@ -320,9 +320,9 @@ void ClangModelManagerSupport::updateLanguageClient(
|
||||
using namespace ProjectExplorer;
|
||||
if (!SessionManager::hasProject(project))
|
||||
return;
|
||||
if (!CppTools::ClangdProjectSettings(project).settings().useClangd)
|
||||
if (!CppEditor::ClangdProjectSettings(project).settings().useClangd)
|
||||
return;
|
||||
const CppTools::ProjectInfo::ConstPtr newProjectInfo
|
||||
const CppEditor::ProjectInfo::ConstPtr newProjectInfo
|
||||
= cppModelManager()->projectInfo(project);
|
||||
if (!newProjectInfo || *newProjectInfo != *projectInfo)
|
||||
return;
|
||||
@@ -587,7 +587,7 @@ clangProcessorsWithProject(const ProjectExplorer::Project *project)
|
||||
|
||||
static void updateProcessors(const ClangEditorDocumentProcessors &processors)
|
||||
{
|
||||
CppTools::CppModelManager *modelManager = cppModelManager();
|
||||
CppEditor::CppModelManager *modelManager = cppModelManager();
|
||||
for (ClangEditorDocumentProcessor *processor : processors)
|
||||
modelManager->cppEditorDocument(processor->filePath())->resetProcessor();
|
||||
modelManager->updateCppEditorDocuments(/*projectsUpdated=*/ false);
|
||||
@@ -616,13 +616,13 @@ void ClangModelManagerSupport::onAboutToRemoveProject(ProjectExplorer::Project *
|
||||
void ClangModelManagerSupport::onProjectPartsUpdated(ProjectExplorer::Project *project)
|
||||
{
|
||||
QTC_ASSERT(project, return);
|
||||
const CppTools::ProjectInfo::ConstPtr projectInfo = cppModelManager()->projectInfo(project);
|
||||
const CppEditor::ProjectInfo::ConstPtr projectInfo = cppModelManager()->projectInfo(project);
|
||||
QTC_ASSERT(projectInfo, return);
|
||||
|
||||
updateLanguageClient(project, projectInfo);
|
||||
|
||||
QStringList projectPartIds;
|
||||
for (const CppTools::ProjectPart::ConstPtr &projectPart : projectInfo->projectParts())
|
||||
for (const CppEditor::ProjectPart::ConstPtr &projectPart : projectInfo->projectParts())
|
||||
projectPartIds.append(projectPart->id());
|
||||
onProjectPartsRemoved(projectPartIds);
|
||||
}
|
||||
@@ -636,8 +636,8 @@ void ClangModelManagerSupport::onProjectPartsRemoved(const QStringList &projectP
|
||||
void ClangModelManagerSupport::onClangdSettingsChanged()
|
||||
{
|
||||
for (ProjectExplorer::Project * const project : ProjectExplorer::SessionManager::projects()) {
|
||||
const CppTools::ClangdSettings settings(
|
||||
CppTools::ClangdProjectSettings(project).settings());
|
||||
const CppEditor::ClangdSettings settings(
|
||||
CppEditor::ClangdProjectSettings(project).settings());
|
||||
ClangdClient * const client = clientForProject(project);
|
||||
if (!client) {
|
||||
if (settings.useClangd())
|
||||
@@ -741,9 +741,9 @@ QString ClangModelManagerSupportProvider::displayName() const
|
||||
"Clang");
|
||||
}
|
||||
|
||||
CppTools::ModelManagerSupport::Ptr ClangModelManagerSupportProvider::createModelManagerSupport()
|
||||
CppEditor::ModelManagerSupport::Ptr ClangModelManagerSupportProvider::createModelManagerSupport()
|
||||
{
|
||||
return CppTools::ModelManagerSupport::Ptr(new ClangModelManagerSupport);
|
||||
return CppEditor::ModelManagerSupport::Ptr(new ClangModelManagerSupport);
|
||||
}
|
||||
|
||||
} // Internal
|
||||
|
@@ -28,8 +28,8 @@
|
||||
#include "clangcompletionassistprovider.h"
|
||||
#include "clanguiheaderondiskmanager.h"
|
||||
|
||||
#include <cpptools/cppmodelmanagersupport.h>
|
||||
#include <cpptools/projectinfo.h>
|
||||
#include <cppeditor/cppmodelmanagersupport.h>
|
||||
#include <cppeditor/projectinfo.h>
|
||||
|
||||
#include <utils/futuresynchronizer.h>
|
||||
#include <utils/id.h>
|
||||
@@ -44,10 +44,10 @@ class QWidget;
|
||||
QT_END_NAMESPACE
|
||||
|
||||
namespace TextEditor { class TextEditorWidget; }
|
||||
namespace CppTools {
|
||||
namespace CppEditor {
|
||||
class FollowSymbolInterface;
|
||||
class RefactoringEngineInterface;
|
||||
} // namespace CppTools
|
||||
} // namespace CppEditor
|
||||
|
||||
namespace ClangCodeModel {
|
||||
namespace Internal {
|
||||
@@ -57,7 +57,7 @@ class ClangProjectSettings;
|
||||
|
||||
class ClangModelManagerSupport:
|
||||
public QObject,
|
||||
public CppTools::ModelManagerSupport
|
||||
public CppEditor::ModelManagerSupport
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
@@ -65,14 +65,14 @@ public:
|
||||
ClangModelManagerSupport();
|
||||
~ClangModelManagerSupport() override;
|
||||
|
||||
CppTools::CppCompletionAssistProvider *completionAssistProvider() override;
|
||||
CppTools::CppCompletionAssistProvider *functionHintAssistProvider() override;
|
||||
CppEditor::CppCompletionAssistProvider *completionAssistProvider() override;
|
||||
CppEditor::CppCompletionAssistProvider *functionHintAssistProvider() override;
|
||||
TextEditor::BaseHoverHandler *createHoverHandler() override;
|
||||
CppTools::BaseEditorDocumentProcessor *createEditorDocumentProcessor(
|
||||
CppEditor::BaseEditorDocumentProcessor *createEditorDocumentProcessor(
|
||||
TextEditor::TextDocument *baseTextDocument) override;
|
||||
CppTools::FollowSymbolInterface &followSymbolInterface() override;
|
||||
CppTools::RefactoringEngineInterface &refactoringEngineInterface() override;
|
||||
std::unique_ptr<CppTools::AbstractOverviewModel> createOverviewModel() override;
|
||||
CppEditor::FollowSymbolInterface &followSymbolInterface() override;
|
||||
CppEditor::RefactoringEngineInterface &refactoringEngineInterface() override;
|
||||
std::unique_ptr<CppEditor::AbstractOverviewModel> createOverviewModel() override;
|
||||
bool supportsOutline(const TextEditor::TextDocument *document) const override;
|
||||
|
||||
BackendCommunicator &communicator();
|
||||
@@ -130,7 +130,7 @@ private:
|
||||
void connectToWidgetsMarkContextMenuRequested(QWidget *editorWidget);
|
||||
|
||||
void updateLanguageClient(ProjectExplorer::Project *project,
|
||||
const CppTools::ProjectInfo::ConstPtr &projectInfo);
|
||||
const CppEditor::ProjectInfo::ConstPtr &projectInfo);
|
||||
ClangdClient *createClient(ProjectExplorer::Project *project, const Utils::FilePath &jsonDbDir);
|
||||
void claimNonProjectSources(ClangdClient *fallbackClient);
|
||||
|
||||
@@ -139,20 +139,20 @@ private:
|
||||
BackendCommunicator m_communicator;
|
||||
ClangCompletionAssistProvider m_completionAssistProvider;
|
||||
ClangCompletionAssistProvider m_functionHintAssistProvider;
|
||||
std::unique_ptr<CppTools::FollowSymbolInterface> m_followSymbol;
|
||||
std::unique_ptr<CppTools::RefactoringEngineInterface> m_refactoringEngine;
|
||||
std::unique_ptr<CppEditor::FollowSymbolInterface> m_followSymbol;
|
||||
std::unique_ptr<CppEditor::RefactoringEngineInterface> m_refactoringEngine;
|
||||
|
||||
QHash<ProjectExplorer::Project *, ClangProjectSettings *> m_projectSettings;
|
||||
Utils::FutureSynchronizer m_generatorSynchronizer;
|
||||
};
|
||||
|
||||
class ClangModelManagerSupportProvider : public CppTools::ModelManagerSupportProvider
|
||||
class ClangModelManagerSupportProvider : public CppEditor::ModelManagerSupportProvider
|
||||
{
|
||||
public:
|
||||
QString id() const override;
|
||||
QString displayName() const override;
|
||||
|
||||
CppTools::ModelManagerSupport::Ptr createModelManagerSupport() override;
|
||||
CppEditor::ModelManagerSupport::Ptr createModelManagerSupport() override;
|
||||
};
|
||||
|
||||
} // namespace Internal
|
||||
|
@@ -176,11 +176,11 @@ QVariant TokenTreeItem::data(int column, int role) const
|
||||
return CodeModelIcon::iconForType(iconTypeForToken(token));
|
||||
}
|
||||
|
||||
case CppTools::AbstractOverviewModel::FileNameRole: {
|
||||
case CppEditor::AbstractOverviewModel::FileNameRole: {
|
||||
return token.extraInfo.cursorRange.start.filePath.toString();
|
||||
}
|
||||
|
||||
case CppTools::AbstractOverviewModel::LineNumberRole: {
|
||||
case CppEditor::AbstractOverviewModel::LineNumberRole: {
|
||||
return token.line;
|
||||
}
|
||||
|
||||
|
@@ -27,7 +27,7 @@
|
||||
|
||||
#include "tokeninfocontainer.h"
|
||||
|
||||
#include <cpptools/abstractoverviewmodel.h>
|
||||
#include <cppeditor/abstractoverviewmodel.h>
|
||||
|
||||
namespace ClangBackEnd { class TokenInfoContainer; }
|
||||
|
||||
@@ -51,7 +51,7 @@ public:
|
||||
const ClangBackEnd::TokenInfoContainer token;
|
||||
};
|
||||
|
||||
class OverviewModel : public CppTools::AbstractOverviewModel
|
||||
class OverviewModel : public CppEditor::AbstractOverviewModel
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
|
@@ -25,8 +25,8 @@
|
||||
|
||||
#include "clangprojectsettings.h"
|
||||
|
||||
#include <cpptools/cppcodemodelsettings.h>
|
||||
#include <cpptools/cpptoolsreuse.h>
|
||||
#include <cppeditor/cppcodemodelsettings.h>
|
||||
#include <cppeditor/cpptoolsreuse.h>
|
||||
|
||||
#include <utils/qtcassert.h>
|
||||
#include <utils/hostosinfo.h>
|
||||
@@ -77,9 +77,9 @@ ClangProjectSettings::ClangProjectSettings(ProjectExplorer::Project *project)
|
||||
|
||||
Utils::Id ClangProjectSettings::warningConfigId() const
|
||||
{
|
||||
const CppTools::ClangDiagnosticConfigsModel model = CppTools::diagnosticConfigsModel();
|
||||
const CppEditor::ClangDiagnosticConfigsModel model = CppEditor::diagnosticConfigsModel();
|
||||
if (!model.hasConfigWithId(m_warningConfigId))
|
||||
return CppTools::codeModelSettings()->defaultClangDiagnosticConfigId();
|
||||
return CppEditor::codeModelSettings()->defaultClangDiagnosticConfigId();
|
||||
return m_warningConfigId;
|
||||
}
|
||||
|
||||
|
@@ -30,11 +30,11 @@
|
||||
|
||||
#include <coreplugin/icore.h>
|
||||
|
||||
#include <cpptools/clangdiagnosticconfig.h>
|
||||
#include <cpptools/clangdiagnosticconfigswidget.h>
|
||||
#include <cpptools/cppcodemodelsettings.h>
|
||||
#include <cpptools/cpptoolsconstants.h>
|
||||
#include <cpptools/cpptoolsreuse.h>
|
||||
#include <cppeditor/clangdiagnosticconfig.h>
|
||||
#include <cppeditor/clangdiagnosticconfigswidget.h>
|
||||
#include <cppeditor/cppeditorconstants.h>
|
||||
#include <cppeditor/cppcodemodelsettings.h>
|
||||
#include <cppeditor/cpptoolsreuse.h>
|
||||
|
||||
#include <utils/hostosinfo.h>
|
||||
|
||||
@@ -44,7 +44,7 @@ namespace Internal {
|
||||
static Utils::Id configIdForProject(ClangProjectSettings &projectSettings)
|
||||
{
|
||||
if (projectSettings.useGlobalConfig())
|
||||
return CppTools::codeModelSettings()->clangDiagnosticConfigId();
|
||||
return CppEditor::codeModelSettings()->clangDiagnosticConfigId();
|
||||
return projectSettings.warningConfigId();
|
||||
}
|
||||
|
||||
@@ -53,13 +53,13 @@ ClangProjectSettingsWidget::ClangProjectSettingsWidget(ProjectExplorer::Project
|
||||
{
|
||||
m_ui.setupUi(this);
|
||||
|
||||
using namespace CppTools;
|
||||
using namespace CppEditor;
|
||||
|
||||
m_ui.delayedTemplateParseCheckBox->setVisible(Utils::HostOsInfo::isWindowsHost());
|
||||
|
||||
// Links
|
||||
connect(m_ui.gotoGlobalSettingsLabel, &QLabel::linkActivated, [](const QString &) {
|
||||
Core::ICore::showOptionsDialog(CppTools::Constants::CPP_CODE_MODEL_SETTINGS_ID);
|
||||
Core::ICore::showOptionsDialog(CppEditor::Constants::CPP_CODE_MODEL_SETTINGS_ID);
|
||||
});
|
||||
|
||||
connect(m_ui.clangDiagnosticConfigsSelectionWidget,
|
||||
@@ -74,8 +74,8 @@ ClangProjectSettingsWidget::ClangProjectSettingsWidget(ProjectExplorer::Project
|
||||
// Save global custom configs
|
||||
const ClangDiagnosticConfigs configs = m_ui.clangDiagnosticConfigsSelectionWidget
|
||||
->customConfigs();
|
||||
CppTools::codeModelSettings()->setClangCustomDiagnosticConfigs(configs);
|
||||
CppTools::codeModelSettings()->toSettings(Core::ICore::settings());
|
||||
CppEditor::codeModelSettings()->setClangCustomDiagnosticConfigs(configs);
|
||||
CppEditor::codeModelSettings()->toSettings(Core::ICore::settings());
|
||||
});
|
||||
|
||||
connect(m_ui.delayedTemplateParseCheckBox, &QCheckBox::toggled,
|
||||
@@ -88,7 +88,7 @@ ClangProjectSettingsWidget::ClangProjectSettingsWidget(ProjectExplorer::Project
|
||||
|
||||
connect(&m_projectSettings, &ClangProjectSettings::changed,
|
||||
this, &ClangProjectSettingsWidget::syncWidgets);
|
||||
connect(CppTools::codeModelSettings(), &CppTools::CppCodeModelSettings::changed,
|
||||
connect(CppEditor::codeModelSettings(), &CppEditor::CppCodeModelSettings::changed,
|
||||
this, &ClangProjectSettingsWidget::syncOtherWidgetsToComboBox);
|
||||
|
||||
syncWidgets();
|
||||
@@ -117,7 +117,7 @@ void ClangProjectSettingsWidget::onGlobalCustomChanged(int index)
|
||||
|
||||
void ClangProjectSettingsWidget::onAboutToSaveProjectSettings()
|
||||
{
|
||||
CppTools::codeModelSettings()->toSettings(Core::ICore::settings());
|
||||
CppEditor::codeModelSettings()->toSettings(Core::ICore::settings());
|
||||
}
|
||||
|
||||
void ClangProjectSettingsWidget::syncWidgets()
|
||||
@@ -147,11 +147,11 @@ void ClangProjectSettingsWidget::syncOtherWidgetsToComboBox()
|
||||
}
|
||||
|
||||
m_ui.clangDiagnosticConfigsSelectionWidget
|
||||
->refresh(CppTools::diagnosticConfigsModel(),
|
||||
->refresh(CppEditor::diagnosticConfigsModel(),
|
||||
configIdForProject(m_projectSettings),
|
||||
[](const CppTools::ClangDiagnosticConfigs &configs,
|
||||
[](const CppEditor::ClangDiagnosticConfigs &configs,
|
||||
const Utils::Id &configToSelect) {
|
||||
return new CppTools::ClangDiagnosticConfigsWidget(configs, configToSelect);
|
||||
return new CppEditor::ClangDiagnosticConfigsWidget(configs, configToSelect);
|
||||
});
|
||||
}
|
||||
|
||||
|
@@ -57,7 +57,7 @@ However, using the relaxed and extended rules means also that no highlighting/co
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="CppTools::ClangDiagnosticConfigsSelectionWidget" name="clangDiagnosticConfigsSelectionWidget" native="true"/>
|
||||
<widget class="CppEditor::ClangDiagnosticConfigsSelectionWidget" name="clangDiagnosticConfigsSelectionWidget" native="true"/>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="verticalSpacer">
|
||||
@@ -76,9 +76,9 @@ However, using the relaxed and extended rules means also that no highlighting/co
|
||||
</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,7 +30,7 @@
|
||||
#include "clangmodelmanagersupport.h"
|
||||
#include "sourcelocationscontainer.h"
|
||||
|
||||
#include <cpptools/cppmodelmanager.h>
|
||||
#include <cppeditor/cppmodelmanager.h>
|
||||
#include <languageclient/languageclientsymbolsupport.h>
|
||||
#include <utils/textutils.h>
|
||||
#include <utils/qtcassert.h>
|
||||
@@ -38,8 +38,8 @@
|
||||
namespace ClangCodeModel {
|
||||
namespace Internal {
|
||||
|
||||
void RefactoringEngine::startLocalRenaming(const CppTools::CursorInEditor &data,
|
||||
const CppTools::ProjectPart *,
|
||||
void RefactoringEngine::startLocalRenaming(const CppEditor::CursorInEditor &data,
|
||||
const CppEditor::ProjectPart *,
|
||||
RenameCallback &&renameSymbolsCallback)
|
||||
{
|
||||
ClangdClient * const client
|
||||
@@ -62,7 +62,7 @@ void RefactoringEngine::startLocalRenaming(const CppTools::CursorInEditor &data,
|
||||
if (!processor)
|
||||
return defaultCallback();
|
||||
|
||||
QFuture<CppTools::CursorInfo> cursorFuture = processor->requestLocalReferences(data.cursor());
|
||||
QFuture<CppEditor::CursorInfo> cursorFuture = processor->requestLocalReferences(data.cursor());
|
||||
if (cursorFuture.isCanceled())
|
||||
return defaultCallback();
|
||||
|
||||
@@ -73,7 +73,7 @@ void RefactoringEngine::startLocalRenaming(const CppTools::CursorInEditor &data,
|
||||
QObject::connect(m_watcher.get(), &FutureCursorWatcher::finished, [=]() {
|
||||
if (m_watcher->isCanceled())
|
||||
return defaultCallback();
|
||||
const CppTools::CursorInfo info = m_watcher->result();
|
||||
const CppEditor::CursorInfo info = m_watcher->result();
|
||||
if (info.useRanges.empty())
|
||||
return defaultCallback();
|
||||
|
||||
@@ -93,14 +93,14 @@ void RefactoringEngine::startLocalRenaming(const CppTools::CursorInEditor &data,
|
||||
m_watcher->setFuture(cursorFuture);
|
||||
}
|
||||
|
||||
void RefactoringEngine::globalRename(const CppTools::CursorInEditor &cursor,
|
||||
CppTools::UsagesCallback &&callback,
|
||||
void RefactoringEngine::globalRename(const CppEditor::CursorInEditor &cursor,
|
||||
CppEditor::UsagesCallback &&callback,
|
||||
const QString &replacement)
|
||||
{
|
||||
ClangdClient * const client
|
||||
= ClangModelManagerSupport::instance()->clientForFile(cursor.filePath());
|
||||
if (!client || !client->isFullyIndexed()) {
|
||||
CppTools::CppModelManager::builtinRefactoringEngine()
|
||||
CppEditor::CppModelManager::builtinRefactoringEngine()
|
||||
->globalRename(cursor, std::move(callback), replacement);
|
||||
return;
|
||||
}
|
||||
@@ -109,13 +109,13 @@ void RefactoringEngine::globalRename(const CppTools::CursorInEditor &cursor,
|
||||
client->findUsages(cursor.textDocument(), cursor.cursor(), replacement);
|
||||
}
|
||||
|
||||
void RefactoringEngine::findUsages(const CppTools::CursorInEditor &cursor,
|
||||
CppTools::UsagesCallback &&callback) const
|
||||
void RefactoringEngine::findUsages(const CppEditor::CursorInEditor &cursor,
|
||||
CppEditor::UsagesCallback &&callback) const
|
||||
{
|
||||
ClangdClient * const client
|
||||
= ClangModelManagerSupport::instance()->clientForFile(cursor.filePath());
|
||||
if (!client || !client->isFullyIndexed()) {
|
||||
CppTools::CppModelManager::builtinRefactoringEngine()
|
||||
CppEditor::CppModelManager::builtinRefactoringEngine()
|
||||
->findUsages(cursor, std::move(callback));
|
||||
return;
|
||||
}
|
||||
@@ -125,17 +125,17 @@ void RefactoringEngine::findUsages(const CppTools::CursorInEditor &cursor,
|
||||
}
|
||||
|
||||
void RefactoringEngine::globalFollowSymbol(
|
||||
const CppTools::CursorInEditor &cursor,
|
||||
const CppEditor::CursorInEditor &cursor,
|
||||
Utils::ProcessLinkCallback &&callback,
|
||||
const CPlusPlus::Snapshot &snapshot,
|
||||
const CPlusPlus::Document::Ptr &doc,
|
||||
CppTools::SymbolFinder *symbolFinder,
|
||||
CppEditor::SymbolFinder *symbolFinder,
|
||||
bool inNextSplit) const
|
||||
{
|
||||
ClangdClient * const client
|
||||
= ClangModelManagerSupport::instance()->clientForFile(cursor.filePath());
|
||||
if (!client || !client->isFullyIndexed()) {
|
||||
CppTools::CppModelManager::builtinRefactoringEngine()
|
||||
CppEditor::CppModelManager::builtinRefactoringEngine()
|
||||
->globalFollowSymbol(cursor, std::move(callback), snapshot, doc, symbolFinder,
|
||||
inNextSplit);
|
||||
return;
|
||||
|
@@ -25,8 +25,8 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <cpptools/refactoringengineinterface.h>
|
||||
#include <cpptools/cppcursorinfo.h>
|
||||
#include <cppeditor/refactoringengineinterface.h>
|
||||
#include <cppeditor/cppcursorinfo.h>
|
||||
|
||||
#include <QFutureWatcher>
|
||||
|
||||
@@ -38,25 +38,25 @@ class RefactoringServerInterface;
|
||||
namespace ClangCodeModel {
|
||||
namespace Internal {
|
||||
|
||||
class RefactoringEngine : public CppTools::RefactoringEngineInterface
|
||||
class RefactoringEngine : public CppEditor::RefactoringEngineInterface
|
||||
{
|
||||
public:
|
||||
void startLocalRenaming(const CppTools::CursorInEditor &data,
|
||||
const CppTools::ProjectPart *projectPart,
|
||||
void startLocalRenaming(const CppEditor::CursorInEditor &data,
|
||||
const CppEditor::ProjectPart *projectPart,
|
||||
RenameCallback &&renameSymbolsCallback) override;
|
||||
void globalRename(const CppTools::CursorInEditor &cursor, CppTools::UsagesCallback &&callback,
|
||||
void globalRename(const CppEditor::CursorInEditor &cursor, CppEditor::UsagesCallback &&callback,
|
||||
const QString &replacement) override;
|
||||
void findUsages(const CppTools::CursorInEditor &cursor,
|
||||
CppTools::UsagesCallback &&callback) const override;
|
||||
void globalFollowSymbol(const CppTools::CursorInEditor &cursor,
|
||||
void findUsages(const CppEditor::CursorInEditor &cursor,
|
||||
CppEditor::UsagesCallback &&callback) const override;
|
||||
void globalFollowSymbol(const CppEditor::CursorInEditor &cursor,
|
||||
::Utils::ProcessLinkCallback &&callback,
|
||||
const CPlusPlus::Snapshot &snapshot,
|
||||
const CPlusPlus::Document::Ptr &doc,
|
||||
CppTools::SymbolFinder *symbolFinder,
|
||||
CppEditor::SymbolFinder *symbolFinder,
|
||||
bool inNextSplit) const override;
|
||||
|
||||
private:
|
||||
using FutureCursorWatcher = QFutureWatcher<CppTools::CursorInfo>;
|
||||
using FutureCursorWatcher = QFutureWatcher<CppEditor::CursorInfo>;
|
||||
std::unique_ptr<FutureCursorWatcher> m_watcher;
|
||||
};
|
||||
|
||||
|
@@ -34,10 +34,10 @@
|
||||
#include "clangutils.h"
|
||||
|
||||
#include <coreplugin/icore.h>
|
||||
#include <cpptools/cpptoolsconstants.h>
|
||||
#include <cpptools/clangdiagnosticconfigsmodel.h>
|
||||
#include <cpptools/cpptoolsreuse.h>
|
||||
#include <cpptools/cppcodemodelsettings.h>
|
||||
#include <cppeditor/clangdiagnosticconfigsmodel.h>
|
||||
#include <cppeditor/cppeditorconstants.h>
|
||||
#include <cppeditor/cpptoolsreuse.h>
|
||||
#include <cppeditor/cppcodemodelsettings.h>
|
||||
|
||||
#include <utils/fadingindicator.h>
|
||||
#include <utils/qtcassert.h>
|
||||
@@ -50,7 +50,7 @@
|
||||
#include <QLayout>
|
||||
#include <QString>
|
||||
|
||||
using namespace CppTools;
|
||||
using namespace CppEditor;
|
||||
using namespace ClangCodeModel::Internal;
|
||||
using namespace LanguageClient;
|
||||
using namespace LanguageServerProtocol;
|
||||
@@ -141,7 +141,7 @@ ClangDiagnosticConfig diagnosticConfig(const ClangProjectSettings &projectSettin
|
||||
currentConfigId = globalSettings.clangDiagnosticConfigId();
|
||||
|
||||
// Get config
|
||||
ClangDiagnosticConfigsModel configsModel = CppTools::diagnosticConfigsModel();
|
||||
ClangDiagnosticConfigsModel configsModel = CppEditor::diagnosticConfigsModel();
|
||||
QTC_ASSERT(configsModel.hasConfigWithId(currentConfigId), return {});
|
||||
return configsModel.configWithId(currentConfigId);
|
||||
}
|
||||
@@ -176,7 +176,7 @@ void disableDiagnosticInCurrentProjectConfig(const ClangBackEnd::DiagnosticConta
|
||||
|
||||
// Get config
|
||||
ClangDiagnosticConfig config = diagnosticConfig(projectSettings, *globalSettings);
|
||||
ClangDiagnosticConfigsModel configsModel = CppTools::diagnosticConfigsModel();
|
||||
ClangDiagnosticConfigsModel configsModel = CppEditor::diagnosticConfigsModel();
|
||||
|
||||
// Create copy if needed
|
||||
if (config.isReadOnly()) {
|
||||
@@ -222,7 +222,7 @@ ClangTextMark::ClangTextMark(const FilePath &fileName,
|
||||
, m_removedFromEditorHandler(removedHandler)
|
||||
, m_diagMgr(diagMgr)
|
||||
{
|
||||
setSettingsPage(CppTools::Constants::CPP_CODE_MODEL_SETTINGS_ID);
|
||||
setSettingsPage(CppEditor::Constants::CPP_CODE_MODEL_SETTINGS_ID);
|
||||
|
||||
const bool warning = isWarningOrNote(diagnostic.severity);
|
||||
setDefaultToolTip(warning ? QApplication::translate("Clang Code Model Marks", "Code Model Warning")
|
||||
@@ -350,7 +350,7 @@ ClangdTextMark::ClangdTextMark(const FilePath &filePath,
|
||||
, m_diagnostic(convertDiagnostic(ClangdDiagnostic(diagnostic), filePath))
|
||||
, m_client(client)
|
||||
{
|
||||
setSettingsPage(CppTools::Constants::CPP_CODE_MODEL_SETTINGS_ID);
|
||||
setSettingsPage(CppEditor::Constants::CPP_CODE_MODEL_SETTINGS_ID);
|
||||
|
||||
const bool isError = diagnostic.severity()
|
||||
&& *diagnostic.severity() == DiagnosticSeverity::Error;
|
||||
|
@@ -33,13 +33,13 @@
|
||||
|
||||
#include <coreplugin/icore.h>
|
||||
#include <coreplugin/idocument.h>
|
||||
#include <cpptools/baseeditordocumentparser.h>
|
||||
#include <cpptools/compileroptionsbuilder.h>
|
||||
#include <cpptools/cppcodemodelsettings.h>
|
||||
#include <cpptools/cppmodelmanager.h>
|
||||
#include <cpptools/cpptoolsreuse.h>
|
||||
#include <cpptools/editordocumenthandle.h>
|
||||
#include <cpptools/projectpart.h>
|
||||
#include <cppeditor/baseeditordocumentparser.h>
|
||||
#include <cppeditor/compileroptionsbuilder.h>
|
||||
#include <cppeditor/cppcodemodelsettings.h>
|
||||
#include <cppeditor/cppmodelmanager.h>
|
||||
#include <cppeditor/cpptoolsreuse.h>
|
||||
#include <cppeditor/editordocumenthandle.h>
|
||||
#include <cppeditor/projectpart.h>
|
||||
#include <projectexplorer/buildconfiguration.h>
|
||||
#include <projectexplorer/kitinformation.h>
|
||||
#include <projectexplorer/projectexplorerconstants.h>
|
||||
@@ -60,7 +60,7 @@
|
||||
#include <QTextBlock>
|
||||
|
||||
using namespace Core;
|
||||
using namespace CppTools;
|
||||
using namespace CppEditor;
|
||||
using namespace ProjectExplorer;
|
||||
using namespace Utils;
|
||||
|
||||
@@ -111,7 +111,7 @@ private:
|
||||
|
||||
ProjectPart::ConstPtr projectPartForFile(const QString &filePath)
|
||||
{
|
||||
if (const auto parser = CppTools::BaseEditorDocumentParser::get(filePath))
|
||||
if (const auto parser = CppEditor::BaseEditorDocumentParser::get(filePath))
|
||||
return parser->projectPartInfo().projectPart;
|
||||
return ProjectPart::ConstPtr();
|
||||
}
|
||||
@@ -141,7 +141,7 @@ QString projectPartIdForFile(const QString &filePath)
|
||||
|
||||
CppEditorDocumentHandle *cppDocument(const QString &filePath)
|
||||
{
|
||||
return CppTools::CppModelManager::instance()->cppEditorDocument(filePath);
|
||||
return CppEditor::CppModelManager::instance()->cppEditorDocument(filePath);
|
||||
}
|
||||
|
||||
void setLastSentDocumentRevision(const QString &filePath, uint revision)
|
||||
@@ -371,7 +371,7 @@ static QJsonObject createFileObject(const FilePath &buildDir,
|
||||
return fileObject;
|
||||
}
|
||||
|
||||
GenerateCompilationDbResult generateCompilationDB(const CppTools::ProjectInfo::ConstPtr projectInfo,
|
||||
GenerateCompilationDbResult generateCompilationDB(const CppEditor::ProjectInfo::ConstPtr projectInfo,
|
||||
CompilationDbPurpose purpose,
|
||||
const ClangDiagnosticConfig &warningsConfig,
|
||||
const QStringList &projectOptions)
|
||||
@@ -415,7 +415,7 @@ QString currentCppEditorDocumentFilePath()
|
||||
QString filePath;
|
||||
|
||||
const auto currentEditor = Core::EditorManager::currentEditor();
|
||||
if (currentEditor && CppTools::CppModelManager::isCppEditor(currentEditor)) {
|
||||
if (currentEditor && CppEditor::CppModelManager::isCppEditor(currentEditor)) {
|
||||
const auto currentDocument = currentEditor->document();
|
||||
if (currentDocument)
|
||||
filePath = currentDocument->filePath().toString();
|
||||
@@ -482,7 +482,7 @@ static ClangProjectSettings &getProjectSettings(ProjectExplorer::Project *projec
|
||||
class FileOptionsBuilder
|
||||
{
|
||||
public:
|
||||
FileOptionsBuilder(const QString &filePath, const CppTools::ProjectPart &projectPart,
|
||||
FileOptionsBuilder(const QString &filePath, const CppEditor::ProjectPart &projectPart,
|
||||
const ClangDiagnosticConfig &warningsConfig,
|
||||
const QStringList &projectOptions)
|
||||
: m_filePath(filePath)
|
||||
@@ -502,7 +502,7 @@ public:
|
||||
}
|
||||
|
||||
const QStringList &options() const { return m_options; }
|
||||
CppTools::UseBuildSystemWarnings useBuildSystemWarnings() const
|
||||
CppEditor::UseBuildSystemWarnings useBuildSystemWarnings() const
|
||||
{
|
||||
return m_useBuildSystemWarnings;
|
||||
}
|
||||
@@ -511,13 +511,13 @@ private:
|
||||
void addLanguageOptions()
|
||||
{
|
||||
// Determine file kind with respect to ambiguous headers.
|
||||
CppTools::ProjectFile::Kind fileKind = CppTools::ProjectFile::Unclassified;
|
||||
CppEditor::ProjectFile::Kind fileKind = CppEditor::ProjectFile::Unclassified;
|
||||
if (!m_filePath.isEmpty())
|
||||
fileKind = CppTools::ProjectFile::classify(m_filePath);
|
||||
if (fileKind == CppTools::ProjectFile::AmbiguousHeader) {
|
||||
fileKind = CppEditor::ProjectFile::classify(m_filePath);
|
||||
if (fileKind == CppEditor::ProjectFile::AmbiguousHeader) {
|
||||
fileKind = m_projectPart.languageVersion <= ::Utils::LanguageVersion::LatestC
|
||||
? CppTools::ProjectFile::CHeader
|
||||
: CppTools::ProjectFile::CXXHeader;
|
||||
? CppEditor::ProjectFile::CHeader
|
||||
: CppEditor::ProjectFile::CXXHeader;
|
||||
}
|
||||
|
||||
m_builder.reset();
|
||||
@@ -531,26 +531,26 @@ private:
|
||||
addDiagnosticOptionsForConfig(m_warningsConfig);
|
||||
}
|
||||
|
||||
void addDiagnosticOptionsForConfig(const CppTools::ClangDiagnosticConfig &diagnosticConfig)
|
||||
void addDiagnosticOptionsForConfig(const CppEditor::ClangDiagnosticConfig &diagnosticConfig)
|
||||
{
|
||||
m_useBuildSystemWarnings = diagnosticConfig.useBuildSystemWarnings()
|
||||
? CppTools::UseBuildSystemWarnings::Yes
|
||||
: CppTools::UseBuildSystemWarnings::No;
|
||||
? CppEditor::UseBuildSystemWarnings::Yes
|
||||
: CppEditor::UseBuildSystemWarnings::No;
|
||||
|
||||
const QStringList options = m_isClMode
|
||||
? CppTools::clangArgsForCl(diagnosticConfig.clangOptions())
|
||||
? CppEditor::clangArgsForCl(diagnosticConfig.clangOptions())
|
||||
: diagnosticConfig.clangOptions();
|
||||
m_options.append(options);
|
||||
}
|
||||
|
||||
void addGlobalDiagnosticOptions()
|
||||
{
|
||||
m_options += CppTools::ClangDiagnosticConfigsModel::globalDiagnosticOptions();
|
||||
m_options += CppEditor::ClangDiagnosticConfigsModel::globalDiagnosticOptions();
|
||||
}
|
||||
|
||||
void addPrecompiledHeaderOptions()
|
||||
{
|
||||
using namespace CppTools;
|
||||
using namespace CppEditor;
|
||||
|
||||
if (getPchUsage() == UsePrecompiledHeaders::No)
|
||||
return;
|
||||
@@ -566,11 +566,11 @@ private:
|
||||
|
||||
private:
|
||||
const QString &m_filePath;
|
||||
const CppTools::ProjectPart &m_projectPart;
|
||||
const CppEditor::ProjectPart &m_projectPart;
|
||||
const ClangDiagnosticConfig &m_warningsConfig;
|
||||
|
||||
CppTools::UseBuildSystemWarnings m_useBuildSystemWarnings = CppTools::UseBuildSystemWarnings::No;
|
||||
CppTools::CompilerOptionsBuilder m_builder;
|
||||
CppEditor::UseBuildSystemWarnings m_useBuildSystemWarnings = CppEditor::UseBuildSystemWarnings::No;
|
||||
CppEditor::CompilerOptionsBuilder m_builder;
|
||||
bool m_isClMode = false;
|
||||
QStringList m_options;
|
||||
};
|
||||
@@ -582,7 +582,7 @@ QStringList createClangOptions(const ProjectPart &projectPart, const QString &fi
|
||||
{
|
||||
const FileOptionsBuilder fileOptions(filePath, projectPart, warningsConfig, projectOptions);
|
||||
LibClangOptionsBuilder optionsBuilder(projectPart, fileOptions.useBuildSystemWarnings());
|
||||
const QStringList projectPartOptions = optionsBuilder.build(CppTools::ProjectFile::Unsupported,
|
||||
const QStringList projectPartOptions = optionsBuilder.build(CppEditor::ProjectFile::Unsupported,
|
||||
UsePrecompiledHeaders::No);
|
||||
return projectPartOptions + fileOptions.options();
|
||||
}
|
||||
@@ -594,13 +594,13 @@ ClangDiagnosticConfig warningsConfigForProject(Project *project)
|
||||
->projectSettings(project);
|
||||
if (!projectSettings.useGlobalConfig()) {
|
||||
const Utils::Id warningConfigId = projectSettings.warningConfigId();
|
||||
const CppTools::ClangDiagnosticConfigsModel configsModel
|
||||
= CppTools::diagnosticConfigsModel();
|
||||
const CppEditor::ClangDiagnosticConfigsModel configsModel
|
||||
= CppEditor::diagnosticConfigsModel();
|
||||
if (configsModel.hasConfigWithId(warningConfigId))
|
||||
return configsModel.configWithId(warningConfigId);
|
||||
}
|
||||
}
|
||||
return CppTools::codeModelSettings()->clangDiagnosticConfig();
|
||||
return CppEditor::codeModelSettings()->clangDiagnosticConfig();
|
||||
}
|
||||
|
||||
const QStringList optionsForProject(ProjectExplorer::Project *project)
|
||||
|
@@ -27,8 +27,8 @@
|
||||
|
||||
#include <cplusplus/Icons.h>
|
||||
|
||||
#include <cpptools/projectinfo.h>
|
||||
#include <cpptools/compileroptionsbuilder.h>
|
||||
#include <cppeditor/projectinfo.h>
|
||||
#include <cppeditor/compileroptionsbuilder.h>
|
||||
|
||||
#include <QPair>
|
||||
#include <QTextCursor>
|
||||
@@ -37,7 +37,7 @@ QT_BEGIN_NAMESPACE
|
||||
class QTextBlock;
|
||||
QT_END_NAMESPACE
|
||||
|
||||
namespace CppTools {
|
||||
namespace CppEditor {
|
||||
class ClangDiagnosticConfig;
|
||||
class CppEditorDocumentHandle;
|
||||
}
|
||||
@@ -51,19 +51,19 @@ namespace ProjectExplorer { class Project; }
|
||||
namespace ClangCodeModel {
|
||||
namespace Internal {
|
||||
|
||||
CppTools::CppEditorDocumentHandle *cppDocument(const QString &filePath);
|
||||
CppEditor::CppEditorDocumentHandle *cppDocument(const QString &filePath);
|
||||
void setLastSentDocumentRevision(const QString &filePath, uint revision);
|
||||
|
||||
CppTools::ClangDiagnosticConfig warningsConfigForProject(ProjectExplorer::Project *project);
|
||||
CppEditor::ClangDiagnosticConfig warningsConfigForProject(ProjectExplorer::Project *project);
|
||||
const QStringList optionsForProject(ProjectExplorer::Project *project);
|
||||
|
||||
QStringList createClangOptions(const CppTools::ProjectPart &projectPart, const QString &filePath,
|
||||
const CppTools::ClangDiagnosticConfig &warningsConfig,
|
||||
QStringList createClangOptions(const CppEditor::ProjectPart &projectPart, const QString &filePath,
|
||||
const CppEditor::ClangDiagnosticConfig &warningsConfig,
|
||||
const QStringList &projectOptions);
|
||||
|
||||
CppTools::ProjectPart::ConstPtr projectPartForFile(const QString &filePath);
|
||||
CppTools::ProjectPart::ConstPtr projectPartForFileBasedOnProcessor(const QString &filePath);
|
||||
bool isProjectPartLoaded(const CppTools::ProjectPart::ConstPtr projectPart);
|
||||
CppEditor::ProjectPart::ConstPtr projectPartForFile(const QString &filePath);
|
||||
CppEditor::ProjectPart::ConstPtr projectPartForFileBasedOnProcessor(const QString &filePath);
|
||||
bool isProjectPartLoaded(const CppEditor::ProjectPart::ConstPtr projectPart);
|
||||
QString projectPartIdForFile(const QString &filePath);
|
||||
int clangColumn(const QTextBlock &line, int cppEditorColumn);
|
||||
int cppEditorColumn(const QTextBlock &line, int clangColumn);
|
||||
@@ -87,8 +87,8 @@ public:
|
||||
};
|
||||
|
||||
enum class CompilationDbPurpose { Project, CodeModel };
|
||||
GenerateCompilationDbResult generateCompilationDB(const CppTools::ProjectInfo::ConstPtr projectInfo,
|
||||
CompilationDbPurpose purpose, const CppTools::ClangDiagnosticConfig &warningsConfig,
|
||||
GenerateCompilationDbResult generateCompilationDB(const CppEditor::ProjectInfo::ConstPtr projectInfo,
|
||||
CompilationDbPurpose purpose, const CppEditor::ClangDiagnosticConfig &warningsConfig,
|
||||
const QStringList &projectOptions);
|
||||
|
||||
class DiagnosticTextInfo
|
||||
|
@@ -32,10 +32,10 @@
|
||||
#include <coreplugin/editormanager/editormanager.h>
|
||||
#include <coreplugin/editormanager/ieditor.h>
|
||||
#include <coreplugin/icore.h>
|
||||
#include <cpptools/cpptoolsreuse.h>
|
||||
#include <cpptools/cpptoolstestcase.h>
|
||||
#include <cpptools/modelmanagertesthelper.h>
|
||||
#include <cpptools/projectinfo.h>
|
||||
#include <cppeditor/cpptoolsreuse.h>
|
||||
#include <cppeditor/cpptoolstestcase.h>
|
||||
#include <cppeditor/modelmanagertesthelper.h>
|
||||
#include <cppeditor/projectinfo.h>
|
||||
#include <projectexplorer/projectexplorer.h>
|
||||
#include <texteditor/codeassist/assistinterface.h>
|
||||
#include <texteditor/codeassist/assistproposalitem.h>
|
||||
@@ -238,7 +238,7 @@ bool OpenProjectCommand::run()
|
||||
Project *project = openProjectSucceeded.project();
|
||||
project->configureAsExampleProject(nullptr);
|
||||
|
||||
return CppTools::Tests::TestCase::waitUntilProjectIsFullyOpened(project, timeOutInMs());
|
||||
return CppEditor::Tests::TestCase::waitUntilProjectIsFullyOpened(project, timeOutInMs());
|
||||
}
|
||||
|
||||
Command::Ptr OpenProjectCommand::parse(BatchFileLineTokenizer &arguments,
|
||||
|
@@ -35,10 +35,10 @@
|
||||
#include <coreplugin/editormanager/editormanager.h>
|
||||
#include <coreplugin/editormanager/ieditor.h>
|
||||
#include <coreplugin/icore.h>
|
||||
#include <cpptools/cpptoolsreuse.h>
|
||||
#include <cpptools/cpptoolstestcase.h>
|
||||
#include <cpptools/modelmanagertesthelper.h>
|
||||
#include <cpptools/projectinfo.h>
|
||||
#include <cppeditor/cpptoolsreuse.h>
|
||||
#include <cppeditor/cpptoolstestcase.h>
|
||||
#include <cppeditor/modelmanagertesthelper.h>
|
||||
#include <cppeditor/projectinfo.h>
|
||||
#include <texteditor/codeassist/assistproposalitem.h>
|
||||
#include <texteditor/codeassist/genericproposalmodel.h>
|
||||
#include <texteditor/textdocument.h>
|
||||
@@ -57,9 +57,9 @@ using namespace ClangCodeModel::Internal;
|
||||
|
||||
namespace {
|
||||
|
||||
CppTools::Tests::TemporaryDir *globalTemporaryDir()
|
||||
CppEditor::Tests::TemporaryDir *globalTemporaryDir()
|
||||
{
|
||||
static CppTools::Tests::TemporaryDir dir;
|
||||
static CppEditor::Tests::TemporaryDir dir;
|
||||
QTC_CHECK(dir.isValid());
|
||||
return &dir;
|
||||
}
|
||||
@@ -102,7 +102,7 @@ private:
|
||||
class TestDocument
|
||||
{
|
||||
public:
|
||||
TestDocument(const QByteArray &fileName, CppTools::Tests::TemporaryDir *temporaryDir = nullptr)
|
||||
TestDocument(const QByteArray &fileName, CppEditor::Tests::TemporaryDir *temporaryDir = nullptr)
|
||||
{
|
||||
QTC_ASSERT(!fileName.isEmpty(), return);
|
||||
const QResource resource(qrcPath("completion/" + fileName));
|
||||
@@ -122,7 +122,7 @@ public:
|
||||
}
|
||||
|
||||
static TestDocument fromString(const QByteArray &fileName, const QByteArray &contents,
|
||||
CppTools::Tests::TemporaryDir *tempDir = nullptr)
|
||||
CppEditor::Tests::TemporaryDir *tempDir = nullptr)
|
||||
{
|
||||
TestDocument testDocument;
|
||||
testDocument.finish(fileName, contents, tempDir);
|
||||
@@ -146,12 +146,12 @@ private:
|
||||
TestDocument() = default;
|
||||
|
||||
void finish(const QByteArray &fileName, const QByteArray &contents,
|
||||
CppTools::Tests::TemporaryDir *temporaryDir = nullptr)
|
||||
CppEditor::Tests::TemporaryDir *temporaryDir = nullptr)
|
||||
{
|
||||
cursorPosition = findCursorMarkerPosition(contents);
|
||||
if (!contents.isEmpty()) {
|
||||
if (!temporaryDir) {
|
||||
m_temporaryDir.reset(new CppTools::Tests::TemporaryDir);
|
||||
m_temporaryDir.reset(new CppEditor::Tests::TemporaryDir);
|
||||
temporaryDir = m_temporaryDir.data();
|
||||
}
|
||||
|
||||
@@ -159,7 +159,7 @@ private:
|
||||
}
|
||||
}
|
||||
|
||||
QSharedPointer<CppTools::Tests::TemporaryDir> m_temporaryDir;
|
||||
QSharedPointer<CppEditor::Tests::TemporaryDir> m_temporaryDir;
|
||||
};
|
||||
|
||||
class OpenEditorAtCursorPosition
|
||||
@@ -246,11 +246,11 @@ bool OpenEditorAtCursorPosition::waitUntil(const std::function<bool ()> &conditi
|
||||
return false;
|
||||
}
|
||||
|
||||
CppTools::ProjectPart::ConstPtr createProjectPart(const Utils::FilePath &projectFilePath,
|
||||
CppEditor::ProjectPart::ConstPtr createProjectPart(const Utils::FilePath &projectFilePath,
|
||||
const QStringList &files,
|
||||
const ProjectExplorer::Macros ¯os)
|
||||
{
|
||||
using namespace CppTools;
|
||||
using namespace CppEditor;
|
||||
|
||||
ProjectExplorer::RawProjectPart rpp;
|
||||
rpp.setProjectFileLocation("myproject.project");
|
||||
@@ -262,14 +262,14 @@ CppTools::ProjectPart::ConstPtr createProjectPart(const Utils::FilePath &project
|
||||
return ProjectPart::create(projectFilePath, rpp, {}, projectFiles);
|
||||
}
|
||||
|
||||
CppTools::ProjectInfo::ConstPtr createProjectInfo(ProjectExplorer::Project *project,
|
||||
CppEditor::ProjectInfo::ConstPtr createProjectInfo(ProjectExplorer::Project *project,
|
||||
const QStringList &files,
|
||||
const ProjectExplorer::Macros ¯os)
|
||||
{
|
||||
using namespace CppTools;
|
||||
using namespace CppEditor;
|
||||
QTC_ASSERT(project, return {});
|
||||
|
||||
const CppTools::ProjectPart::ConstPtr projectPart
|
||||
const CppEditor::ProjectPart::ConstPtr projectPart
|
||||
= createProjectPart(project->projectFilePath(), files, macros);
|
||||
const auto projectInfo = ProjectInfo::create(
|
||||
{project, ProjectExplorer::KitInfo(nullptr), {}, {}}, {projectPart});
|
||||
@@ -292,7 +292,7 @@ public:
|
||||
bool load()
|
||||
{
|
||||
m_project = m_helper.createProject(QLatin1String("testProject"));
|
||||
const CppTools::ProjectInfo::ConstPtr projectInfo = createProjectInfo(m_project,
|
||||
const CppEditor::ProjectInfo::ConstPtr projectInfo = createProjectInfo(m_project,
|
||||
m_projectFiles,
|
||||
m_projectMacros);
|
||||
const QSet<QString> filesIndexedAfterLoading = m_helper.updateProjectInfo(projectInfo);
|
||||
@@ -302,14 +302,14 @@ public:
|
||||
bool updateProject(const ProjectExplorer::Macros &updatedProjectMacros)
|
||||
{
|
||||
QTC_ASSERT(m_project, return false);
|
||||
const CppTools::ProjectInfo::ConstPtr updatedProjectInfo
|
||||
const CppEditor::ProjectInfo::ConstPtr updatedProjectInfo
|
||||
= createProjectInfo(m_project, m_projectFiles, updatedProjectMacros);
|
||||
return updateProjectInfo(updatedProjectInfo);
|
||||
|
||||
}
|
||||
|
||||
private:
|
||||
bool updateProjectInfo(const CppTools::ProjectInfo::ConstPtr &projectInfo)
|
||||
bool updateProjectInfo(const CppEditor::ProjectInfo::ConstPtr &projectInfo)
|
||||
{
|
||||
const QSet<QString> filesIndexedAfterLoading = m_helper.updateProjectInfo(projectInfo);
|
||||
return m_projectFiles.size() == filesIndexedAfterLoading.size();
|
||||
@@ -318,7 +318,7 @@ private:
|
||||
ProjectExplorer::Project *m_project;
|
||||
QStringList m_projectFiles;
|
||||
ProjectExplorer::Macros m_projectMacros;
|
||||
CppTools::Tests::ModelManagerTestHelper m_helper;
|
||||
CppEditor::Tests::ModelManagerTestHelper m_helper;
|
||||
};
|
||||
|
||||
class ProjectLessCompletionTest
|
||||
@@ -329,7 +329,7 @@ public:
|
||||
const QStringList &includePaths = QStringList(),
|
||||
const QByteArray &contents = {})
|
||||
{
|
||||
CppTools::Tests::TestCase garbageCollectionGlobalSnapshot;
|
||||
CppEditor::Tests::TestCase garbageCollectionGlobalSnapshot;
|
||||
QVERIFY(garbageCollectionGlobalSnapshot.succeededSoFar());
|
||||
|
||||
const auto testDocument = contents.isEmpty()
|
||||
@@ -427,8 +427,8 @@ private:
|
||||
|
||||
MonitorGeneratedUiFile::MonitorGeneratedUiFile()
|
||||
{
|
||||
connect(CppTools::CppModelManager::instance(),
|
||||
&CppTools::CppModelManager::abstractEditorSupportContentsUpdated,
|
||||
connect(CppEditor::CppModelManager::instance(),
|
||||
&CppEditor::CppModelManager::abstractEditorSupportContentsUpdated,
|
||||
this, &MonitorGeneratedUiFile::onUiFileGenerated);
|
||||
}
|
||||
|
||||
@@ -534,7 +534,7 @@ void ClangCodeCompletionTest::testCompletePreprocessorKeywords()
|
||||
|
||||
void ClangCodeCompletionTest::testCompleteIncludeDirective()
|
||||
{
|
||||
CppTools::Tests::TemporaryCopiedDir testDir(qrcPath("completion/exampleIncludeDir"));
|
||||
CppEditor::Tests::TemporaryCopiedDir testDir(qrcPath("completion/exampleIncludeDir"));
|
||||
ProjectLessCompletionTest t("includeDirectiveCompletion.cpp",
|
||||
QString(),
|
||||
QStringList(testDir.path()));
|
||||
@@ -713,14 +713,14 @@ void ClangCodeCompletionTest::testCompleteProjectDependingCodeAfterChangingProje
|
||||
|
||||
void ClangCodeCompletionTest::testCompleteProjectDependingCodeInGeneratedUiFile()
|
||||
{
|
||||
CppTools::Tests::TemporaryCopiedDir testDir(qrcPath("qt-widgets-app"));
|
||||
CppEditor::Tests::TemporaryCopiedDir testDir(qrcPath("qt-widgets-app"));
|
||||
QVERIFY(testDir.isValid());
|
||||
|
||||
MonitorGeneratedUiFile monitorGeneratedUiFile;
|
||||
|
||||
// Open project
|
||||
const QString projectFilePath = testDir.absolutePath("qt-widgets-app.pro");
|
||||
CppTools::Tests::ProjectOpenerAndCloser projectManager;
|
||||
CppEditor::Tests::ProjectOpenerAndCloser projectManager;
|
||||
QVERIFY(projectManager.open(projectFilePath, true));
|
||||
QVERIFY(monitorGeneratedUiFile.waitUntilGenerated());
|
||||
|
||||
|
@@ -32,10 +32,10 @@
|
||||
|
||||
#include <clangsupport/sourcelocationscontainer.h>
|
||||
#include <cplusplus/FindUsages.h>
|
||||
#include <cpptools/cppcodemodelsettings.h>
|
||||
#include <cpptools/cpptoolsreuse.h>
|
||||
#include <cpptools/cpptoolstestcase.h>
|
||||
#include <cpptools/semantichighlighter.h>
|
||||
#include <cppeditor/cppcodemodelsettings.h>
|
||||
#include <cppeditor/cpptoolsreuse.h>
|
||||
#include <cppeditor/cpptoolstestcase.h>
|
||||
#include <cppeditor/semantichighlighter.h>
|
||||
#include <coreplugin/editormanager/editormanager.h>
|
||||
#include <languageclient/languageclientmanager.h>
|
||||
#include <projectexplorer/kitmanager.h>
|
||||
@@ -61,7 +61,7 @@
|
||||
|
||||
using namespace CPlusPlus;
|
||||
using namespace Core;
|
||||
using namespace CppTools::Tests;
|
||||
using namespace CppEditor::Tests;
|
||||
using namespace ProjectExplorer;
|
||||
using namespace TextEditor;
|
||||
|
||||
@@ -132,11 +132,11 @@ void ClangdTest::initTestCase()
|
||||
{
|
||||
const QString clangdFromEnv = qEnvironmentVariable("QTC_CLANGD");
|
||||
if (!clangdFromEnv.isEmpty())
|
||||
CppTools::ClangdSettings::setClangdFilePath(Utils::FilePath::fromString(clangdFromEnv));
|
||||
const auto clangd = CppTools::ClangdSettings::instance().clangdFilePath();
|
||||
CppEditor::ClangdSettings::setClangdFilePath(Utils::FilePath::fromString(clangdFromEnv));
|
||||
const auto clangd = CppEditor::ClangdSettings::instance().clangdFilePath();
|
||||
if (clangd.isEmpty() || !clangd.exists())
|
||||
QSKIP("clangd binary not found");
|
||||
CppTools::ClangdSettings::setUseClangd(true);
|
||||
CppEditor::ClangdSettings::setUseClangd(true);
|
||||
|
||||
// Find suitable kit.
|
||||
m_kit = Utils::findOr(KitManager::kits(), nullptr, [](const Kit *k) {
|
||||
@@ -183,7 +183,7 @@ ClangdTestFindReferences::ClangdTestFindReferences()
|
||||
void ClangdTestFindReferences::initTestCase()
|
||||
{
|
||||
ClangdTest::initTestCase();
|
||||
CppTools::codeModelSettings()->setCategorizeFindReferences(true);
|
||||
CppEditor::codeModelSettings()->setCategorizeFindReferences(true);
|
||||
connect(client(), &ClangdClient::foundReferences, this,
|
||||
[this](const QList<SearchResultItem> &results) {
|
||||
if (results.isEmpty())
|
||||
@@ -877,19 +877,19 @@ void ClangdTestHighlighting::test_data()
|
||||
QTest::newRow("operator= call") << 664 << 12 << 664 << 13
|
||||
<< QList<int>{C_PUNCTUATION, C_OPERATOR, C_OVERLOADED_OPERATOR} << 0;
|
||||
QTest::newRow("ternary operator (question mark)") << 668 << 18 << 668 << 19
|
||||
<< QList<int>{C_PUNCTUATION, C_OPERATOR} << int(CppTools::SemanticHighlighter::TernaryIf);
|
||||
<< QList<int>{C_PUNCTUATION, C_OPERATOR} << int(CppEditor::SemanticHighlighter::TernaryIf);
|
||||
QTest::newRow("ternary operator (colon)") << 668 << 23 << 668 << 24
|
||||
<< QList<int>{C_PUNCTUATION, C_OPERATOR} << int(CppTools::SemanticHighlighter::TernaryElse);
|
||||
<< QList<int>{C_PUNCTUATION, C_OPERATOR} << int(CppEditor::SemanticHighlighter::TernaryElse);
|
||||
QTest::newRow("opening angle bracket in function template declaration")
|
||||
<< 247 << 10 << 247 << 11
|
||||
<< QList<int>{C_PUNCTUATION} << int(CppTools::SemanticHighlighter::AngleBracketOpen);
|
||||
<< QList<int>{C_PUNCTUATION} << int(CppEditor::SemanticHighlighter::AngleBracketOpen);
|
||||
QTest::newRow("closing angle bracket in function template declaration")
|
||||
<< 247 << 18 << 247 << 19
|
||||
<< QList<int>{C_PUNCTUATION} << int(CppTools::SemanticHighlighter::AngleBracketClose);
|
||||
<< QList<int>{C_PUNCTUATION} << int(CppEditor::SemanticHighlighter::AngleBracketClose);
|
||||
QTest::newRow("opening angle bracket in class template declaration") << 261 << 10 << 261 << 11
|
||||
<< QList<int>{C_PUNCTUATION} << int(CppTools::SemanticHighlighter::AngleBracketOpen);
|
||||
<< QList<int>{C_PUNCTUATION} << int(CppEditor::SemanticHighlighter::AngleBracketOpen);
|
||||
QTest::newRow("closing angle bracket in class template declaration") << 261 << 18 << 261 << 19
|
||||
<< QList<int>{C_PUNCTUATION} << int(CppTools::SemanticHighlighter::AngleBracketClose);
|
||||
<< QList<int>{C_PUNCTUATION} << int(CppEditor::SemanticHighlighter::AngleBracketClose);
|
||||
QTest::newRow("macro definition") << 231 << 9 << 231 << 31
|
||||
<< QList<int>{C_PREPROCESSOR, C_DECLARATION} << 0;
|
||||
QTest::newRow("function-like macro definition") << 232 << 9 << 232 << 24
|
||||
@@ -915,16 +915,16 @@ void ClangdTestHighlighting::test_data()
|
||||
<< QList<int>{C_TYPE} << 0;
|
||||
QTest::newRow("outer opening angle bracket in nested template declaration")
|
||||
<< 265 << 10 << 265 << 11
|
||||
<< QList<int>{C_PUNCTUATION} << int(CppTools::SemanticHighlighter::AngleBracketOpen);
|
||||
<< QList<int>{C_PUNCTUATION} << int(CppEditor::SemanticHighlighter::AngleBracketOpen);
|
||||
QTest::newRow("inner opening angle bracket in nested template declaration")
|
||||
<< 265 << 89 << 265 << 90
|
||||
<< QList<int>{C_PUNCTUATION} << int(CppTools::SemanticHighlighter::AngleBracketOpen);
|
||||
<< QList<int>{C_PUNCTUATION} << int(CppEditor::SemanticHighlighter::AngleBracketOpen);
|
||||
QTest::newRow("inner closing angle bracket in nested template declaration")
|
||||
<< 265 << 95 << 265 << 96
|
||||
<< QList<int>{C_PUNCTUATION} << int(CppTools::SemanticHighlighter::AngleBracketClose);
|
||||
<< QList<int>{C_PUNCTUATION} << int(CppEditor::SemanticHighlighter::AngleBracketClose);
|
||||
QTest::newRow("outer closing angle bracket in nested template declaration")
|
||||
<< 265 << 142 << 265 << 143
|
||||
<< QList<int>{C_PUNCTUATION} << int(CppTools::SemanticHighlighter::AngleBracketClose);
|
||||
<< QList<int>{C_PUNCTUATION} << int(CppEditor::SemanticHighlighter::AngleBracketClose);
|
||||
QTest::newRow("function template declaration") << 266 << 6 << 266 << 22
|
||||
<< QList<int>{C_FUNCTION, C_FUNCTION_DEFINITION, C_DECLARATION} << 0;
|
||||
QTest::newRow("template type parameter reference") << 268 << 5 << 268 << 26
|
||||
@@ -958,9 +958,9 @@ void ClangdTestHighlighting::test_data()
|
||||
QTest::newRow("type in static_cast") << 328 << 23 << 328 << 33
|
||||
<< QList<int>{C_TYPE} << 0;
|
||||
QTest::newRow("opening angle bracket in static_cast") << 328 << 16 << 328 << 17
|
||||
<< QList<int>{C_PUNCTUATION} << int(CppTools::SemanticHighlighter::AngleBracketOpen);
|
||||
<< QList<int>{C_PUNCTUATION} << int(CppEditor::SemanticHighlighter::AngleBracketOpen);
|
||||
QTest::newRow("closing angle bracket in static_cast") << 328 << 39 << 328 << 40
|
||||
<< QList<int>{C_PUNCTUATION} << int(CppTools::SemanticHighlighter::AngleBracketClose);
|
||||
<< QList<int>{C_PUNCTUATION} << int(CppEditor::SemanticHighlighter::AngleBracketClose);
|
||||
QTest::newRow("type in reinterpret_cast") << 329 << 28 << 329 << 38
|
||||
<< QList<int>{C_TYPE} << 0;
|
||||
QTest::newRow("integer alias declaration") << 333 << 7 << 333 << 25
|
||||
@@ -988,9 +988,9 @@ void ClangdTestHighlighting::test_data()
|
||||
QTest::newRow("class template instantiation (name)") << 384 << 5 << 384 << 18
|
||||
<< QList<int>{C_TYPE} << 0;
|
||||
QTest::newRow("class template instantiation (opening angle bracket)") << 384 << 18 << 384 << 19
|
||||
<< QList<int>{C_PUNCTUATION} << int(CppTools::SemanticHighlighter::AngleBracketOpen);
|
||||
<< QList<int>{C_PUNCTUATION} << int(CppEditor::SemanticHighlighter::AngleBracketOpen);
|
||||
QTest::newRow("class template instantiation (closing angle bracket)") << 384 << 22 << 384 << 23
|
||||
<< QList<int>{C_PUNCTUATION} << int(CppTools::SemanticHighlighter::AngleBracketClose);
|
||||
<< QList<int>{C_PUNCTUATION} << int(CppEditor::SemanticHighlighter::AngleBracketClose);
|
||||
QTest::newRow("namespace in declaration") << 413 << 4 << 413 << 26 << QList<int>{C_TYPE} << 0;
|
||||
QTest::newRow("namespaced class in declaration") << 413 << 28 << 413 << 41
|
||||
<< QList<int>{C_TYPE} << 0;
|
||||
@@ -1102,55 +1102,55 @@ void ClangdTestHighlighting::test_data()
|
||||
QTest::newRow("static private member") << 696 << 16 << 696 << 28
|
||||
<< QList<int>{C_FIELD, C_DECLARATION} << 0;
|
||||
QTest::newRow("alias template declaration (opening angle bracket)") << 700 << 10 << 700 << 11
|
||||
<< QList<int>{C_PUNCTUATION} << int(CppTools::SemanticHighlighter::AngleBracketOpen);
|
||||
<< QList<int>{C_PUNCTUATION} << int(CppEditor::SemanticHighlighter::AngleBracketOpen);
|
||||
QTest::newRow("alias template declaration (closing angle bracket)") << 700 << 16 << 700 << 17
|
||||
<< QList<int>{C_PUNCTUATION} << int(CppTools::SemanticHighlighter::AngleBracketClose);
|
||||
<< QList<int>{C_PUNCTUATION} << int(CppEditor::SemanticHighlighter::AngleBracketClose);
|
||||
QTest::newRow("alias template declaration (new type)") << 700 << 24 << 700 << 28
|
||||
<< QList<int>{C_TYPE, C_DECLARATION} << 0;
|
||||
QTest::newRow("alias template declaration (base type)") << 700 << 31 << 700 << 32
|
||||
<< QList<int>{C_TYPE} << 0;
|
||||
QTest::newRow("alias template declaration (base type opening angle bracket)")
|
||||
<< 700 << 32 << 700 << 33
|
||||
<< QList<int>{C_PUNCTUATION} << int(CppTools::SemanticHighlighter::AngleBracketOpen);
|
||||
<< QList<int>{C_PUNCTUATION} << int(CppEditor::SemanticHighlighter::AngleBracketOpen);
|
||||
QTest::newRow("alias template declaration (base type closing angle bracket)")
|
||||
<< 700 << 37 << 700 << 38
|
||||
<< QList<int>{C_PUNCTUATION} << int(CppTools::SemanticHighlighter::AngleBracketClose);
|
||||
<< QList<int>{C_PUNCTUATION} << int(CppEditor::SemanticHighlighter::AngleBracketClose);
|
||||
QTest::newRow("alias template instantiation (type)") << 701 << 1 << 701 << 5
|
||||
<< QList<int>{C_TYPE} << 0;
|
||||
QTest::newRow("alias template instantiation (opening angle bracket)") << 701 << 5 << 701 << 6
|
||||
<< QList<int>{C_PUNCTUATION} << int(CppTools::SemanticHighlighter::AngleBracketOpen);
|
||||
<< QList<int>{C_PUNCTUATION} << int(CppEditor::SemanticHighlighter::AngleBracketOpen);
|
||||
QTest::newRow("alias template instantiation (closing angle bracket)") << 701 << 7 << 701 << 8
|
||||
<< QList<int>{C_PUNCTUATION} << int(CppTools::SemanticHighlighter::AngleBracketClose);
|
||||
<< QList<int>{C_PUNCTUATION} << int(CppEditor::SemanticHighlighter::AngleBracketClose);
|
||||
QTest::newRow("function template specialization (opening angle bracket 1)")
|
||||
<< 802 << 9 << 802 << 10
|
||||
<< QList<int>{C_PUNCTUATION} << int(CppTools::SemanticHighlighter::AngleBracketOpen);
|
||||
<< QList<int>{C_PUNCTUATION} << int(CppEditor::SemanticHighlighter::AngleBracketOpen);
|
||||
QTest::newRow("function template specialization (closing angle bracket 1)")
|
||||
<< 802 << 10 << 802 << 11
|
||||
<< QList<int>{C_PUNCTUATION} << int(CppTools::SemanticHighlighter::AngleBracketClose);
|
||||
<< QList<int>{C_PUNCTUATION} << int(CppEditor::SemanticHighlighter::AngleBracketClose);
|
||||
QTest::newRow("function template specialization (function name)")
|
||||
<< 802 << 17 << 802 << 29
|
||||
<< QList<int>{C_FUNCTION, C_FUNCTION_DEFINITION, C_DECLARATION} << 0;
|
||||
QTest::newRow("function template specialization (opening angle bracket 2)")
|
||||
<< 802 << 29 << 802 << 30
|
||||
<< QList<int>{C_PUNCTUATION} << int(CppTools::SemanticHighlighter::AngleBracketOpen);
|
||||
<< QList<int>{C_PUNCTUATION} << int(CppEditor::SemanticHighlighter::AngleBracketOpen);
|
||||
QTest::newRow("function template specialization (closing angle bracket 2)")
|
||||
<< 802 << 33 << 802 << 34
|
||||
<< QList<int>{C_PUNCTUATION} << int(CppTools::SemanticHighlighter::AngleBracketClose);
|
||||
<< QList<int>{C_PUNCTUATION} << int(CppEditor::SemanticHighlighter::AngleBracketClose);
|
||||
QTest::newRow("class template specialization (opening angle bracket 1)")
|
||||
<< 804 << 9 << 804 << 10
|
||||
<< QList<int>{C_PUNCTUATION} << int(CppTools::SemanticHighlighter::AngleBracketOpen);
|
||||
<< QList<int>{C_PUNCTUATION} << int(CppEditor::SemanticHighlighter::AngleBracketOpen);
|
||||
QTest::newRow("class template specialization (closing angle bracket 1)")
|
||||
<< 804 << 10 << 804 << 11
|
||||
<< QList<int>{C_PUNCTUATION} << int(CppTools::SemanticHighlighter::AngleBracketClose);
|
||||
<< QList<int>{C_PUNCTUATION} << int(CppEditor::SemanticHighlighter::AngleBracketClose);
|
||||
QTest::newRow("class template specialization (class name)")
|
||||
<< 804 << 18 << 804 << 21
|
||||
<< QList<int>{C_TYPE, C_DECLARATION} << 0;
|
||||
QTest::newRow("class template specialization (opening angle bracket 2)")
|
||||
<< 804 << 21 << 804 << 22
|
||||
<< QList<int>{C_PUNCTUATION} << int(CppTools::SemanticHighlighter::AngleBracketOpen);
|
||||
<< QList<int>{C_PUNCTUATION} << int(CppEditor::SemanticHighlighter::AngleBracketOpen);
|
||||
QTest::newRow("class template specialization (closing angle bracket 2)")
|
||||
<< 804 << 25 << 804 << 26
|
||||
<< QList<int>{C_PUNCTUATION} << int(CppTools::SemanticHighlighter::AngleBracketClose);
|
||||
<< QList<int>{C_PUNCTUATION} << int(CppEditor::SemanticHighlighter::AngleBracketClose);
|
||||
QTest::newRow("structured binding (var 1)") << 737 << 17 << 737 << 18
|
||||
<< QList<int>{C_LOCAL, C_DECLARATION} << 0;
|
||||
QTest::newRow("structured binding (var 2)") << 737 << 20 << 737 << 21
|
||||
@@ -1167,64 +1167,64 @@ void ClangdTestHighlighting::test_data()
|
||||
<< QList<int>{C_TYPE} << 0;
|
||||
QTest::newRow("nested template instantiation (opening angle bracket 1)")
|
||||
<< 773 << 19 << 773 << 20
|
||||
<< QList<int>{C_PUNCTUATION} << int(CppTools::SemanticHighlighter::AngleBracketOpen);
|
||||
<< QList<int>{C_PUNCTUATION} << int(CppEditor::SemanticHighlighter::AngleBracketOpen);
|
||||
QTest::newRow("nested template instantiation (namespace 2)") << 773 << 20 << 773 << 23
|
||||
<< QList<int>{C_TYPE} << 0;
|
||||
QTest::newRow("nested template instantiation (type 2)") << 773 << 25 << 773 << 29
|
||||
<< QList<int>{C_TYPE} << 0;
|
||||
QTest::newRow("nested template instantiation (opening angle bracket 2)")
|
||||
<< 773 << 29 << 773 << 30
|
||||
<< QList<int>{C_PUNCTUATION} << int(CppTools::SemanticHighlighter::AngleBracketOpen);
|
||||
<< QList<int>{C_PUNCTUATION} << int(CppEditor::SemanticHighlighter::AngleBracketOpen);
|
||||
QTest::newRow("nested template instantiation (closing angle bracket 1)")
|
||||
<< 773 << 38 << 773 << 39
|
||||
<< QList<int>{C_PUNCTUATION} << int(CppTools::SemanticHighlighter::AngleBracketClose);
|
||||
<< QList<int>{C_PUNCTUATION} << int(CppEditor::SemanticHighlighter::AngleBracketClose);
|
||||
QTest::newRow("nested template instantiation (closing angle bracket 2)")
|
||||
<< 773 << 39 << 773 << 40
|
||||
<< QList<int>{C_PUNCTUATION} << int(CppTools::SemanticHighlighter::AngleBracketClose);
|
||||
<< QList<int>{C_PUNCTUATION} << int(CppEditor::SemanticHighlighter::AngleBracketClose);
|
||||
QTest::newRow("nested template instantiation (variable)") << 773 << 41 << 773 << 43
|
||||
<< QList<int>{C_GLOBAL, C_DECLARATION} << 0;
|
||||
QTest::newRow("doubly nested template instantiation (opening angle bracket 1)")
|
||||
<< 806 << 12 << 806 << 13
|
||||
<< QList<int>{C_PUNCTUATION} << int(CppTools::SemanticHighlighter::AngleBracketOpen);
|
||||
<< QList<int>{C_PUNCTUATION} << int(CppEditor::SemanticHighlighter::AngleBracketOpen);
|
||||
QTest::newRow("doubly nested template instantiation (opening angle bracket 2)")
|
||||
<< 806 << 24 << 806 << 25
|
||||
<< QList<int>{C_PUNCTUATION} << int(CppTools::SemanticHighlighter::AngleBracketOpen);
|
||||
<< QList<int>{C_PUNCTUATION} << int(CppEditor::SemanticHighlighter::AngleBracketOpen);
|
||||
QTest::newRow("doubly nested template instantiation (opening angle bracket 3)")
|
||||
<< 806 << 36 << 806 << 37
|
||||
<< QList<int>{C_PUNCTUATION} << int(CppTools::SemanticHighlighter::AngleBracketOpen);
|
||||
<< QList<int>{C_PUNCTUATION} << int(CppEditor::SemanticHighlighter::AngleBracketOpen);
|
||||
QTest::newRow("doubly nested template instantiation (closing angle bracket 1)")
|
||||
<< 806 << 40 << 806 << 41
|
||||
<< QList<int>{C_PUNCTUATION} << int(CppTools::SemanticHighlighter::AngleBracketClose);
|
||||
<< QList<int>{C_PUNCTUATION} << int(CppEditor::SemanticHighlighter::AngleBracketClose);
|
||||
QTest::newRow("doubly nested template instantiation (closing angle bracket 2)")
|
||||
<< 806 << 41 << 806 << 42
|
||||
<< QList<int>{C_PUNCTUATION} << int(CppTools::SemanticHighlighter::AngleBracketClose);
|
||||
<< QList<int>{C_PUNCTUATION} << int(CppEditor::SemanticHighlighter::AngleBracketClose);
|
||||
QTest::newRow("doubly nested template instantiation (closing angle bracket 3)")
|
||||
<< 806 << 42 << 806 << 43
|
||||
<< QList<int>{C_PUNCTUATION} << int(CppTools::SemanticHighlighter::AngleBracketClose);
|
||||
<< QList<int>{C_PUNCTUATION} << int(CppEditor::SemanticHighlighter::AngleBracketClose);
|
||||
QTest::newRow("triply nested template instantiation with spacing (opening angle bracket 1)")
|
||||
<< 808 << 13 << 808 << 14
|
||||
<< QList<int>{C_PUNCTUATION} << int(CppTools::SemanticHighlighter::AngleBracketOpen);
|
||||
<< QList<int>{C_PUNCTUATION} << int(CppEditor::SemanticHighlighter::AngleBracketOpen);
|
||||
QTest::newRow("triply nested template instantiation with spacing (opening angle bracket 2)")
|
||||
<< 808 << 27 << 808 << 28
|
||||
<< QList<int>{C_PUNCTUATION} << int(CppTools::SemanticHighlighter::AngleBracketOpen);
|
||||
<< QList<int>{C_PUNCTUATION} << int(CppEditor::SemanticHighlighter::AngleBracketOpen);
|
||||
QTest::newRow("triply nested template instantiation with spacing (opening angle bracket 3)")
|
||||
<< 808 << 39 << 808 << 40
|
||||
<< QList<int>{C_PUNCTUATION} << int(CppTools::SemanticHighlighter::AngleBracketOpen);
|
||||
<< QList<int>{C_PUNCTUATION} << int(CppEditor::SemanticHighlighter::AngleBracketOpen);
|
||||
QTest::newRow("triply nested template instantiation with spacing (opening angle bracket 4)")
|
||||
<< 809 << 12 << 809 << 13
|
||||
<< QList<int>{C_PUNCTUATION} << int(CppTools::SemanticHighlighter::AngleBracketOpen);
|
||||
<< QList<int>{C_PUNCTUATION} << int(CppEditor::SemanticHighlighter::AngleBracketOpen);
|
||||
QTest::newRow("triply nested template instantiation with spacing (closing angle bracket 1)")
|
||||
<< 810 << 1 << 810 << 2
|
||||
<< QList<int>{C_PUNCTUATION} << int(CppTools::SemanticHighlighter::AngleBracketClose);
|
||||
<< QList<int>{C_PUNCTUATION} << int(CppEditor::SemanticHighlighter::AngleBracketClose);
|
||||
QTest::newRow("triply nested template instantiation with spacing (closing angle bracket 2)")
|
||||
<< 810 << 2 << 810 << 3
|
||||
<< QList<int>{C_PUNCTUATION} << int(CppTools::SemanticHighlighter::AngleBracketClose);
|
||||
<< QList<int>{C_PUNCTUATION} << int(CppEditor::SemanticHighlighter::AngleBracketClose);
|
||||
QTest::newRow("triply nested template instantiation with spacing (closing angle bracket 3)")
|
||||
<< 811 << 2 << 811 << 3
|
||||
<< QList<int>{C_PUNCTUATION} << int(CppTools::SemanticHighlighter::AngleBracketClose);
|
||||
<< QList<int>{C_PUNCTUATION} << int(CppEditor::SemanticHighlighter::AngleBracketClose);
|
||||
QTest::newRow("triply nested template instantiation with spacing (closing angle bracket 4)")
|
||||
<< 812 << 3 << 812 << 4
|
||||
<< QList<int>{C_PUNCTUATION} << int(CppTools::SemanticHighlighter::AngleBracketClose);
|
||||
<< QList<int>{C_PUNCTUATION} << int(CppEditor::SemanticHighlighter::AngleBracketClose);
|
||||
QTest::newRow("cyrillic string") << 792 << 24 << 792 << 27 << QList<int>{C_STRING} << 0;
|
||||
QTest::newRow("macro in struct") << 795 << 9 << 795 << 14
|
||||
<< QList<int>{C_PREPROCESSOR, C_DECLARATION} << 0;
|
||||
|
@@ -25,7 +25,7 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <cpptools/cpptoolstestcase.h>
|
||||
#include <cppeditor/cpptoolstestcase.h>
|
||||
#include <coreplugin/find/searchresultitem.h>
|
||||
#include <texteditor/codeassist/genericproposal.h>
|
||||
#include <texteditor/semantichighlighter.h>
|
||||
@@ -72,7 +72,7 @@ protected slots:
|
||||
virtual void initTestCase();
|
||||
|
||||
private:
|
||||
CppTools::Tests::TemporaryCopiedDir *m_projectDir = nullptr;
|
||||
CppEditor::Tests::TemporaryCopiedDir *m_projectDir = nullptr;
|
||||
QString m_projectFileName;
|
||||
QStringList m_sourceFileNames;
|
||||
QHash<QString, TextEditor::TextDocument *> m_sourceDocuments;
|
||||
|
@@ -2,7 +2,7 @@ add_qtc_plugin(ClangFormat
|
||||
CONDITION TARGET libclang AND LLVM_PACKAGE_VERSION VERSION_GREATER_EQUAL 10.0.0 AND QTC_CLANG_BUILDMODE_MATCH
|
||||
DEPENDS Utils Qt5::Widgets ${CLANG_FORMAT_LIB}
|
||||
INCLUDES "${CLANG_INCLUDE_DIRS}"
|
||||
PLUGIN_DEPENDS Core TextEditor CppEditor CppTools ProjectExplorer
|
||||
PLUGIN_DEPENDS Core TextEditor CppEditor ProjectExplorer
|
||||
SOURCES
|
||||
clangformatbaseindenter.cpp clangformatbaseindenter.h
|
||||
clangformatchecks.ui
|
||||
|
@@ -5,10 +5,9 @@ QtcPlugin {
|
||||
targetName: "ClangFormatPlugin"
|
||||
|
||||
Depends { name: "Core" }
|
||||
Depends { name: "TextEditor" }
|
||||
Depends { name: "CppEditor" }
|
||||
Depends { name: "CppTools" }
|
||||
Depends { name: "ProjectExplorer" }
|
||||
Depends { name: "TextEditor" }
|
||||
Depends { name: "Utils" }
|
||||
|
||||
Depends { name: "libclang"; required: false }
|
||||
|
@@ -3,6 +3,5 @@ QTC_LIB_DEPENDS += \
|
||||
extensionsystem \
|
||||
utils
|
||||
QTC_PLUGIN_DEPENDS += \
|
||||
cpptools \
|
||||
projectexplorer \
|
||||
cppeditor
|
||||
cppeditor \
|
||||
projectexplorer
|
||||
|
@@ -36,7 +36,7 @@
|
||||
|
||||
#include <coreplugin/icore.h>
|
||||
#include <cppeditor/cpphighlighter.h>
|
||||
#include <cpptools/cppcodestylesnippets.h>
|
||||
#include <cppeditor/cppcodestylesnippets.h>
|
||||
#include <extensionsystem/pluginmanager.h>
|
||||
#include <extensionsystem/pluginspec.h>
|
||||
#include <projectexplorer/project.h>
|
||||
@@ -163,7 +163,7 @@ void ClangFormatConfigWidget::initChecksAndPreview()
|
||||
TextEditor::DisplaySettings displaySettings = m_preview->displaySettings();
|
||||
displaySettings.m_visualizeWhitespace = true;
|
||||
m_preview->setDisplaySettings(displaySettings);
|
||||
m_preview->setPlainText(QLatin1String(CppTools::Constants::DEFAULT_CODE_STYLE_SNIPPETS[0]));
|
||||
m_preview->setPlainText(QLatin1String(CppEditor::Constants::DEFAULT_CODE_STYLE_SNIPPETS[0]));
|
||||
m_preview->textDocument()->setIndenter(new ClangFormatIndenter(m_preview->document()));
|
||||
m_preview->textDocument()->setFontSettings(TextEditor::TextEditorSettings::fontSettings());
|
||||
m_preview->textDocument()->setSyntaxHighlighter(new CppEditor::CppHighlighter);
|
||||
|
@@ -44,9 +44,9 @@
|
||||
|
||||
#include <cppeditor/cppeditorconstants.h>
|
||||
|
||||
#include <cpptools/cppcodestylepreferencesfactory.h>
|
||||
#include <cpptools/cpptoolsconstants.h>
|
||||
#include <cpptools/cppmodelmanager.h>
|
||||
#include <cppeditor/cppcodestylepreferencesfactory.h>
|
||||
#include <cppeditor/cppeditorconstants.h>
|
||||
#include <cppeditor/cppmodelmanager.h>
|
||||
|
||||
#include <projectexplorer/kitinformation.h>
|
||||
#include <projectexplorer/project.h>
|
||||
@@ -73,7 +73,7 @@ using namespace Utils;
|
||||
|
||||
namespace ClangFormat {
|
||||
|
||||
class ClangFormatStyleFactory : public CppTools::CppCodeStylePreferencesFactory
|
||||
class ClangFormatStyleFactory : public CppEditor::CppCodeStylePreferencesFactory
|
||||
{
|
||||
public:
|
||||
TextEditor::CodeStyleEditorWidget *createCodeStyleEditor(
|
||||
@@ -99,7 +99,7 @@ public:
|
||||
static void replaceCppCodeStyle()
|
||||
{
|
||||
using namespace TextEditor;
|
||||
TextEditorSettings::unregisterCodeStyleFactory(CppTools::Constants::CPP_SETTINGS_ID);
|
||||
TextEditorSettings::unregisterCodeStyleFactory(CppEditor::Constants::CPP_SETTINGS_ID);
|
||||
TextEditorSettings::registerCodeStyleFactory(new ClangFormatStyleFactory);
|
||||
}
|
||||
|
||||
|
@@ -29,7 +29,7 @@
|
||||
#include "clangformatsettings.h"
|
||||
|
||||
#include <coreplugin/icore.h>
|
||||
#include <cpptools/cppcodestylesettings.h>
|
||||
#include <cppeditor/cppcodestylesettings.h>
|
||||
#include <texteditor/tabsettings.h>
|
||||
#include <projectexplorer/project.h>
|
||||
#include <projectexplorer/session.h>
|
||||
@@ -39,7 +39,7 @@
|
||||
using namespace clang;
|
||||
using namespace format;
|
||||
using namespace llvm;
|
||||
using namespace CppTools;
|
||||
using namespace CppEditor;
|
||||
using namespace ProjectExplorer;
|
||||
using namespace TextEditor;
|
||||
using namespace Utils;
|
||||
|
@@ -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)
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user