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:
Christian Kandeler
2021-09-01 18:08:54 +02:00
parent 0d410ef342
commit 1b723f6fd9
17 changed files with 71 additions and 125 deletions

View File

@@ -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"