forked from qt-creator/qt-creator
CppEditor: Remove unneeded CppEditorWidgetInterface
Removes a pseudo-abstraction and simplifies ClangdClient. Change-Id: I5161d069371ff92a517866bb7500517cab6781b7 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
@@ -41,7 +41,7 @@
|
||||
#include <cppeditor/cppeditorconstants.h>
|
||||
#include <cppeditor/cppcodemodelsettings.h>
|
||||
#include <cppeditor/cppdoxygen.h>
|
||||
#include <cppeditor/cppeditorwidgetinterface.h>
|
||||
#include <cppeditor/cppeditorwidget.h>
|
||||
#include <cppeditor/cppfindreferences.h>
|
||||
#include <cppeditor/cppmodelmanager.h>
|
||||
#include <cppeditor/cpptoolsreuse.h>
|
||||
@@ -532,7 +532,7 @@ private:
|
||||
class ClangdClient::FollowSymbolData {
|
||||
public:
|
||||
FollowSymbolData(ClangdClient *q, quint64 id, const QTextCursor &cursor,
|
||||
CppEditor::CppEditorWidgetInterface *editorWidget,
|
||||
CppEditor::CppEditorWidget *editorWidget,
|
||||
const DocumentUri &uri, Utils::ProcessLinkCallback &&callback,
|
||||
bool openInSplit)
|
||||
: q(q), id(id), cursor(cursor), editorWidget(editorWidget), uri(uri),
|
||||
@@ -561,19 +561,10 @@ public:
|
||||
openedFiles.clear();
|
||||
}
|
||||
|
||||
bool isEditorWidgetStillAlive() const
|
||||
{
|
||||
return Utils::anyOf(EditorManager::visibleEditors(), [this](IEditor *editor) {
|
||||
const auto textEditor = qobject_cast<TextEditor::BaseTextEditor *>(editor);
|
||||
return textEditor && dynamic_cast<CppEditor::CppEditorWidgetInterface *>(
|
||||
textEditor->editorWidget()) == editorWidget;
|
||||
});
|
||||
}
|
||||
|
||||
ClangdClient * const q;
|
||||
const quint64 id;
|
||||
const QTextCursor cursor;
|
||||
CppEditor::CppEditorWidgetInterface * const editorWidget;
|
||||
const QPointer<CppEditor::CppEditorWidget> editorWidget;
|
||||
const DocumentUri uri;
|
||||
const Utils::ProcessLinkCallback callback;
|
||||
VirtualFunctionAssistProvider virtualFuncAssistProvider;
|
||||
@@ -596,7 +587,7 @@ public:
|
||||
class SwitchDeclDefData {
|
||||
public:
|
||||
SwitchDeclDefData(quint64 id, TextEditor::TextDocument *doc, const QTextCursor &cursor,
|
||||
CppEditor::CppEditorWidgetInterface *editorWidget,
|
||||
CppEditor::CppEditorWidget *editorWidget,
|
||||
Utils::ProcessLinkCallback &&callback)
|
||||
: id(id), document(doc), uri(DocumentUri::fromFilePath(doc->filePath())),
|
||||
cursor(cursor), editorWidget(editorWidget), callback(std::move(callback)) {}
|
||||
@@ -639,7 +630,7 @@ public:
|
||||
const QPointer<TextEditor::TextDocument> document;
|
||||
const DocumentUri uri;
|
||||
const QTextCursor cursor;
|
||||
CppEditor::CppEditorWidgetInterface * const editorWidget;
|
||||
const QPointer<CppEditor::CppEditorWidget> editorWidget;
|
||||
Utils::ProcessLinkCallback callback;
|
||||
Utils::optional<DocumentSymbolsResult> docSymbols;
|
||||
Utils::optional<AstNode> ast;
|
||||
@@ -1346,10 +1337,9 @@ void ClangdClient::Private::finishSearch(const ReferencesData &refData, bool can
|
||||
runningFindUsages.remove(refData.key);
|
||||
}
|
||||
|
||||
void ClangdClient::followSymbol(
|
||||
TextEditor::TextDocument *document,
|
||||
void ClangdClient::followSymbol(TextEditor::TextDocument *document,
|
||||
const QTextCursor &cursor,
|
||||
CppEditor::CppEditorWidgetInterface *editorWidget,
|
||||
CppEditor::CppEditorWidget *editorWidget,
|
||||
Utils::ProcessLinkCallback &&callback,
|
||||
bool resolveTarget,
|
||||
bool openInSplit
|
||||
@@ -1409,7 +1399,7 @@ void ClangdClient::followSymbol(
|
||||
}
|
||||
|
||||
void ClangdClient::switchDeclDef(TextEditor::TextDocument *document, const QTextCursor &cursor,
|
||||
CppEditor::CppEditorWidgetInterface *editorWidget,
|
||||
CppEditor::CppEditorWidget *editorWidget,
|
||||
Utils::ProcessLinkCallback &&callback)
|
||||
{
|
||||
QTC_ASSERT(documentOpen(document), openDocument(document));
|
||||
@@ -1767,7 +1757,7 @@ void ClangdClient::Private::handleGotoImplementationResult(
|
||||
// As soon as we know that there is more than one candidate, we start the code assist
|
||||
// procedure, to let the user know that things are happening.
|
||||
if (followSymbolData->allLinks.size() > 1 && !followSymbolData->virtualFuncAssistProcessor
|
||||
&& followSymbolData->isEditorWidgetStillAlive()) {
|
||||
&& followSymbolData->editorWidget) {
|
||||
followSymbolData->editorWidget->invokeTextEditorWidgetAssist(
|
||||
TextEditor::FollowSymbol, &followSymbolData->virtualFuncAssistProvider);
|
||||
}
|
||||
@@ -2745,17 +2735,17 @@ void ClangdClient::VirtualFunctionAssistProcessor::cancel()
|
||||
|
||||
void ClangdClient::VirtualFunctionAssistProcessor::update()
|
||||
{
|
||||
if (!m_data->followSymbolData->isEditorWidgetStillAlive())
|
||||
if (!m_data->followSymbolData->editorWidget)
|
||||
return;
|
||||
setAsyncProposalAvailable(createProposal(false));
|
||||
}
|
||||
|
||||
void ClangdClient::VirtualFunctionAssistProcessor::finalize()
|
||||
{
|
||||
if (!m_data->followSymbolData->isEditorWidgetStillAlive())
|
||||
if (!m_data->followSymbolData->editorWidget)
|
||||
return;
|
||||
const auto proposal = createProposal(true);
|
||||
if (m_data->followSymbolData->editorWidget->inTestMode) {
|
||||
if (m_data->followSymbolData->editorWidget->isInTestMode()) {
|
||||
m_data->followSymbolData->symbolsToDisplay.clear();
|
||||
const auto immediateProposal = createProposal(false);
|
||||
m_data->followSymbolData->editorWidget->setProposals(immediateProposal, proposal);
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
#include <QVersionNumber>
|
||||
|
||||
namespace Core { class SearchResultItem; }
|
||||
namespace CppEditor { class CppEditorWidgetInterface; }
|
||||
namespace CppEditor { class CppEditorWidget; }
|
||||
namespace ProjectExplorer { class Project; }
|
||||
namespace TextEditor { class BaseTextEditor; }
|
||||
|
||||
@@ -61,14 +61,14 @@ public:
|
||||
const Utils::optional<QString> &replacement);
|
||||
void followSymbol(TextEditor::TextDocument *document,
|
||||
const QTextCursor &cursor,
|
||||
CppEditor::CppEditorWidgetInterface *editorWidget,
|
||||
CppEditor::CppEditorWidget *editorWidget,
|
||||
Utils::ProcessLinkCallback &&callback,
|
||||
bool resolveTarget,
|
||||
bool openInSplit);
|
||||
|
||||
void switchDeclDef(TextEditor::TextDocument *document,
|
||||
const QTextCursor &cursor,
|
||||
CppEditor::CppEditorWidgetInterface *editorWidget,
|
||||
CppEditor::CppEditorWidget *editorWidget,
|
||||
Utils::ProcessLinkCallback &&callback);
|
||||
|
||||
void findLocalUsages(TextEditor::TextDocument *document, const QTextCursor &cursor,
|
||||
|
||||
@@ -46,7 +46,6 @@ add_qtc_plugin(CppEditor
|
||||
cppeditoroutline.cpp cppeditoroutline.h
|
||||
cppeditorplugin.cpp cppeditorplugin.h
|
||||
cppeditorwidget.cpp cppeditorwidget.h
|
||||
cppeditorwidgetinterface.h
|
||||
cppelementevaluator.cpp cppelementevaluator.h
|
||||
cppfileiterationorder.cpp cppfileiterationorder.h
|
||||
cppfilesettingspage.cpp cppfilesettingspage.h cppfilesettingspage.ui
|
||||
|
||||
@@ -42,7 +42,6 @@ HEADERS += \
|
||||
cppeditoroutline.h \
|
||||
cppeditorplugin.h \
|
||||
cppeditorwidget.h \
|
||||
cppeditorwidgetinterface.h \
|
||||
cppelementevaluator.h \
|
||||
cppfileiterationorder.h \
|
||||
cppfilesettingspage.h \
|
||||
|
||||
@@ -108,7 +108,6 @@ QtcPlugin {
|
||||
"cppeditoroutline.h",
|
||||
"cppeditorplugin.cpp",
|
||||
"cppeditorplugin.h",
|
||||
"cppeditorwidgetinterface.h",
|
||||
"cppelementevaluator.cpp",
|
||||
"cppelementevaluator.h",
|
||||
"cppfileiterationorder.cpp",
|
||||
|
||||
@@ -32,9 +32,9 @@
|
||||
namespace TextEditor { class BaseTextEditor; }
|
||||
|
||||
namespace CppEditor {
|
||||
namespace Internal {
|
||||
class CppEditorWidget;
|
||||
|
||||
namespace Internal {
|
||||
namespace Tests {
|
||||
|
||||
class GenericCppTestDocument : public CppEditor::Tests::BaseCppTestDocument
|
||||
|
||||
@@ -427,6 +427,7 @@ public:
|
||||
CppLocalRenaming m_localRenaming;
|
||||
CppUseSelectionsUpdater m_useSelectionsUpdater;
|
||||
CppSelectionChanger m_cppSelectionChanger;
|
||||
bool inTestMode = false;
|
||||
};
|
||||
|
||||
CppEditorWidgetPrivate::CppEditorWidgetPrivate(CppEditorWidget *q)
|
||||
@@ -437,6 +438,9 @@ CppEditorWidgetPrivate::CppEditorWidgetPrivate(CppEditorWidget *q)
|
||||
, m_useSelectionsUpdater(q)
|
||||
, m_cppSelectionChanger()
|
||||
{}
|
||||
} // namespace Internal
|
||||
|
||||
using namespace Internal;
|
||||
|
||||
CppEditorWidget::CppEditorWidget()
|
||||
: d(new CppEditorWidgetPrivate(this))
|
||||
@@ -594,7 +598,7 @@ void CppEditorWidget::finalizeInitializationAfterDuplication(TextEditorWidget *o
|
||||
void CppEditorWidget::setProposals(const TextEditor::IAssistProposal *immediateProposal,
|
||||
const TextEditor::IAssistProposal *finalProposal)
|
||||
{
|
||||
QTC_ASSERT(inTestMode, return);
|
||||
QTC_ASSERT(isInTestMode(), return);
|
||||
#ifdef WITH_TESTS
|
||||
emit proposalsReady(immediateProposal, finalProposal);
|
||||
#endif
|
||||
@@ -1504,7 +1508,12 @@ const QList<QTextEdit::ExtraSelection> CppEditorWidget::unselectLeadingWhitespac
|
||||
return filtered;
|
||||
}
|
||||
|
||||
} // namespace Internal
|
||||
bool CppEditorWidget::isInTestMode() const { return d->inTestMode; }
|
||||
|
||||
#ifdef WITH_TESTS
|
||||
void CppEditorWidget::enableTestMode() { d->inTestMode = true; }
|
||||
#endif
|
||||
|
||||
} // namespace CppEditor
|
||||
|
||||
#include "cppeditorwidget.moc"
|
||||
|
||||
@@ -25,12 +25,18 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "cppeditor_global.h"
|
||||
|
||||
#include <texteditor/codeassist/assistenums.h>
|
||||
#include <texteditor/texteditor.h>
|
||||
|
||||
#include "cppeditorwidgetinterface.h"
|
||||
|
||||
#include <QScopedPointer>
|
||||
|
||||
namespace TextEditor {
|
||||
class IAssistProposal;
|
||||
class IAssistProvider;
|
||||
}
|
||||
|
||||
namespace CppEditor {
|
||||
class FollowSymbolInterface;
|
||||
class SemanticInfo;
|
||||
@@ -41,8 +47,9 @@ class CppEditorDocument;
|
||||
class CppEditorOutline;
|
||||
class CppEditorWidgetPrivate;
|
||||
class FunctionDeclDefLink;
|
||||
} // namespace Internal
|
||||
|
||||
class CppEditorWidget : public TextEditor::TextEditorWidget, public CppEditorWidgetInterface
|
||||
class CPPEDITOR_EXPORT CppEditorWidget : public TextEditor::TextEditorWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
@@ -50,14 +57,14 @@ public:
|
||||
CppEditorWidget();
|
||||
~CppEditorWidget() override;
|
||||
|
||||
CppEditorDocument *cppEditorDocument() const;
|
||||
CppEditorOutline *outline() const;
|
||||
Internal::CppEditorDocument *cppEditorDocument() const;
|
||||
Internal::CppEditorOutline *outline() const;
|
||||
|
||||
bool isSemanticInfoValidExceptLocalUses() const;
|
||||
bool isSemanticInfoValid() const;
|
||||
bool isRenaming() const;
|
||||
|
||||
QSharedPointer<FunctionDeclDefLink> declDefLink() const;
|
||||
QSharedPointer<Internal::FunctionDeclDefLink> declDefLink() const;
|
||||
void applyDeclDefLinkChanges(bool jumpToMatch);
|
||||
|
||||
TextEditor::AssistInterface *createAssistInterface(
|
||||
@@ -71,7 +78,7 @@ public:
|
||||
void selectAll() override;
|
||||
|
||||
void switchDeclarationDefinition(bool inNextSplit);
|
||||
void showPreProcessorWidget() override;
|
||||
void showPreProcessorWidget();
|
||||
|
||||
void findUsages() override;
|
||||
void findUsages(QTextCursor cursor);
|
||||
@@ -85,15 +92,19 @@ public:
|
||||
static void updateWidgetHighlighting(QWidget *widget, bool highlight);
|
||||
static bool isWidgetHighlighted(QWidget *widget);
|
||||
|
||||
SemanticInfo semanticInfo() const override;
|
||||
void updateSemanticInfo() override;
|
||||
SemanticInfo semanticInfo() const;
|
||||
void updateSemanticInfo();
|
||||
void invokeTextEditorWidgetAssist(TextEditor::AssistKind assistKind,
|
||||
TextEditor::IAssistProvider *provider) override;
|
||||
TextEditor::IAssistProvider *provider);
|
||||
|
||||
static const QList<QTextEdit::ExtraSelection>
|
||||
unselectLeadingWhitespace(const QList<QTextEdit::ExtraSelection> &selections);
|
||||
|
||||
bool isInTestMode() const;
|
||||
void setProposals(const TextEditor::IAssistProposal *immediateProposal,
|
||||
const TextEditor::IAssistProposal *finalProposal);
|
||||
#ifdef WITH_TESTS
|
||||
void enableTestMode();
|
||||
signals:
|
||||
void proposalsReady(const TextEditor::IAssistProposal *immediateProposal,
|
||||
const TextEditor::IAssistProposal *finalProposal);
|
||||
@@ -116,7 +127,7 @@ private:
|
||||
void updateFunctionDeclDefLink();
|
||||
void updateFunctionDeclDefLinkNow();
|
||||
void abortDeclDefLink();
|
||||
void onFunctionDeclDefLinkFound(QSharedPointer<FunctionDeclDefLink> link);
|
||||
void onFunctionDeclDefLinkFound(QSharedPointer<Internal::FunctionDeclDefLink> link);
|
||||
|
||||
void onCppDocumentUpdated();
|
||||
|
||||
@@ -137,9 +148,6 @@ private:
|
||||
void finalizeInitialization() override;
|
||||
void finalizeInitializationAfterDuplication(TextEditorWidget *other) override;
|
||||
|
||||
void setProposals(const TextEditor::IAssistProposal *immediateProposal,
|
||||
const TextEditor::IAssistProposal *finalProposal) override;
|
||||
|
||||
unsigned documentRevision() const;
|
||||
|
||||
QMenu *createRefactorMenu(QWidget *parent) const;
|
||||
@@ -149,8 +157,7 @@ private:
|
||||
const ProjectPart *projectPart() const;
|
||||
|
||||
private:
|
||||
QScopedPointer<CppEditorWidgetPrivate> d;
|
||||
QScopedPointer<Internal::CppEditorWidgetPrivate> d;
|
||||
};
|
||||
|
||||
} // namespace Internal
|
||||
} // namespace CppEditor
|
||||
|
||||
@@ -1,60 +0,0 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2016 The Qt Company Ltd.
|
||||
** Contact: https://www.qt.io/licensing/
|
||||
**
|
||||
** This file is part of Qt Creator.
|
||||
**
|
||||
** Commercial License Usage
|
||||
** Licensees holding valid commercial Qt licenses may use this file in
|
||||
** accordance with the commercial license agreement provided with the
|
||||
** Software or, alternatively, in accordance with the terms contained in
|
||||
** a written agreement between you and The Qt Company. For licensing terms
|
||||
** and conditions see https://www.qt.io/terms-conditions. For further
|
||||
** information use the contact form at https://www.qt.io/contact-us.
|
||||
**
|
||||
** GNU General Public License Usage
|
||||
** Alternatively, this file may be used under the terms of the GNU
|
||||
** General Public License version 3 as published by the Free Software
|
||||
** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
|
||||
** included in the packaging of this file. Please review the following
|
||||
** information to ensure the GNU General Public License requirements will
|
||||
** be met: https://www.gnu.org/licenses/gpl-3.0.html.
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "cppeditor_global.h"
|
||||
|
||||
#include <texteditor/codeassist/assistenums.h>
|
||||
|
||||
#include <QString>
|
||||
|
||||
namespace TextEditor {
|
||||
class IAssistProposal;
|
||||
class IAssistProvider;
|
||||
}
|
||||
|
||||
namespace CppEditor {
|
||||
|
||||
class SemanticInfo;
|
||||
|
||||
// FIXME: Remove
|
||||
class CPPEDITOR_EXPORT CppEditorWidgetInterface
|
||||
{
|
||||
public:
|
||||
virtual void showPreProcessorWidget() = 0;
|
||||
virtual SemanticInfo semanticInfo() const = 0;
|
||||
virtual void updateSemanticInfo() = 0;
|
||||
|
||||
virtual void invokeTextEditorWidgetAssist(TextEditor::AssistKind assistKind,
|
||||
TextEditor::IAssistProvider *provider) = 0;
|
||||
|
||||
virtual void setProposals(const TextEditor::IAssistProposal *immediateProposal,
|
||||
const TextEditor::IAssistProposal *finalProposal) = 0;
|
||||
|
||||
bool inTestMode = false;
|
||||
};
|
||||
|
||||
} // namespace CppEditor
|
||||
@@ -24,10 +24,12 @@
|
||||
****************************************************************************/
|
||||
|
||||
#include "cppfollowsymbolundercursor.h"
|
||||
#include "cppvirtualfunctionassistprovider.h"
|
||||
|
||||
#include "cppeditorwidget.h"
|
||||
#include "cppmodelmanager.h"
|
||||
#include "functionutils.h"
|
||||
#include "cpptoolsreuse.h"
|
||||
#include "cppvirtualfunctionassistprovider.h"
|
||||
#include "functionutils.h"
|
||||
#include "symbolfinder.h"
|
||||
|
||||
#include <cplusplus/ASTPath.h>
|
||||
@@ -613,7 +615,7 @@ void FollowSymbolUnderCursor::findLink(
|
||||
}
|
||||
}
|
||||
|
||||
CppEditorWidgetInterface *editorWidget = data.editorWidget();
|
||||
CppEditorWidget *editorWidget = data.editorWidget();
|
||||
if (!editorWidget)
|
||||
return processLinkCallback(link);
|
||||
|
||||
|
||||
@@ -35,9 +35,10 @@
|
||||
#include <QTextCursor>
|
||||
|
||||
namespace CppEditor {
|
||||
class CppEditorWidget;
|
||||
|
||||
namespace Internal {
|
||||
|
||||
class CppEditorWidget;
|
||||
class FunctionDeclDefLink;
|
||||
|
||||
class FunctionDeclDefLinkFinder : public QObject
|
||||
|
||||
@@ -34,13 +34,12 @@
|
||||
|
||||
|
||||
namespace CppEditor {
|
||||
class CppEditorWidget;
|
||||
class CppRefactoringFile;
|
||||
using CppRefactoringFilePtr = QSharedPointer<CppRefactoringFile>;
|
||||
|
||||
namespace Internal {
|
||||
|
||||
class CppEditorWidget;
|
||||
|
||||
class CppQuickFixInterface : public TextEditor::AssistInterface
|
||||
{
|
||||
public:
|
||||
|
||||
@@ -26,6 +26,7 @@
|
||||
#include "cpprefactoringengine.h"
|
||||
|
||||
#include "cppcanonicalsymbol.h"
|
||||
#include "cppeditorwidget.h"
|
||||
#include "cppmodelmanager.h"
|
||||
#include "cppsemanticinfo.h"
|
||||
#include "cpptoolsreuse.h"
|
||||
@@ -42,7 +43,7 @@ void CppRefactoringEngine::startLocalRenaming(const CursorInEditor &data,
|
||||
const ProjectPart *,
|
||||
RenameCallback &&renameSymbolsCallback)
|
||||
{
|
||||
CppEditorWidgetInterface *editorWidget = data.editorWidget();
|
||||
CppEditorWidget *editorWidget = data.editorWidget();
|
||||
QTC_ASSERT(editorWidget, renameSymbolsCallback(QString(),
|
||||
ClangBackEnd::SourceLocationsContainer(),
|
||||
0); return;);
|
||||
@@ -61,7 +62,7 @@ void CppRefactoringEngine::globalRename(const CursorInEditor &data,
|
||||
if (!modelManager)
|
||||
return;
|
||||
|
||||
CppEditorWidgetInterface *editorWidget = data.editorWidget();
|
||||
CppEditorWidget *editorWidget = data.editorWidget();
|
||||
QTC_ASSERT(editorWidget, return;);
|
||||
|
||||
SemanticInfo info = editorWidget->semanticInfo();
|
||||
@@ -85,7 +86,7 @@ void CppRefactoringEngine::findUsages(const CursorInEditor &data,
|
||||
if (!modelManager)
|
||||
return;
|
||||
|
||||
CppEditorWidgetInterface *editorWidget = data.editorWidget();
|
||||
CppEditorWidget *editorWidget = data.editorWidget();
|
||||
QTC_ASSERT(editorWidget, return;);
|
||||
|
||||
SemanticInfo info = editorWidget->semanticInfo();
|
||||
|
||||
@@ -53,9 +53,10 @@ class ProgressIndicator;
|
||||
}
|
||||
|
||||
namespace CppEditor {
|
||||
class CppEditorWidget;
|
||||
|
||||
namespace Internal {
|
||||
class CppClass;
|
||||
class CppEditorWidget;
|
||||
class CppElement;
|
||||
|
||||
class CppTypeHierarchyModel : public QStandardItemModel
|
||||
|
||||
@@ -33,10 +33,10 @@
|
||||
#include <QTimer>
|
||||
|
||||
namespace CppEditor {
|
||||
namespace Internal {
|
||||
|
||||
class CppEditorWidget;
|
||||
|
||||
namespace Internal {
|
||||
|
||||
class CppUseSelectionsUpdater : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
@@ -25,8 +25,6 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "cppeditorwidgetinterface.h"
|
||||
|
||||
#include <utils/fileutils.h>
|
||||
|
||||
#include <QTextCursor>
|
||||
@@ -34,26 +32,27 @@
|
||||
namespace TextEditor { class TextDocument; }
|
||||
|
||||
namespace CppEditor {
|
||||
class CppEditorWidget;
|
||||
|
||||
class CursorInEditor
|
||||
{
|
||||
public:
|
||||
CursorInEditor(const QTextCursor &cursor, const Utils::FilePath &filePath,
|
||||
CppEditorWidgetInterface *editorWidget = nullptr,
|
||||
CppEditorWidget *editorWidget = nullptr,
|
||||
TextEditor::TextDocument *textDocument = nullptr)
|
||||
: m_cursor(cursor)
|
||||
, m_filePath(filePath)
|
||||
, m_editorWidget(editorWidget)
|
||||
, m_textDocument(textDocument)
|
||||
{}
|
||||
CppEditorWidgetInterface *editorWidget() const { return m_editorWidget; }
|
||||
CppEditorWidget *editorWidget() const { return m_editorWidget; }
|
||||
TextEditor::TextDocument *textDocument() const { return m_textDocument; }
|
||||
const QTextCursor &cursor() const { return m_cursor; }
|
||||
const Utils::FilePath &filePath() const { return m_filePath; }
|
||||
private:
|
||||
QTextCursor m_cursor;
|
||||
Utils::FilePath m_filePath;
|
||||
CppEditorWidgetInterface *m_editorWidget = nullptr;
|
||||
CppEditorWidget *m_editorWidget = nullptr;
|
||||
TextEditor::TextDocument * const m_textDocument;
|
||||
};
|
||||
|
||||
|
||||
@@ -404,7 +404,7 @@ F2TestCase::F2TestCase(CppEditorAction action,
|
||||
if (!builtinFollowSymbol) {
|
||||
if (curTestName == "testFollowSymbolQTCREATORBUG7903")
|
||||
QSKIP((curTestName + " is not supported by Clang FollowSymbol").toLatin1());
|
||||
widget->inTestMode = true;
|
||||
widget->enableTestMode();
|
||||
widget->openLinkUnderCursor();
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user