Commit d47aed52 authored by Nikolai Kosjar's avatar Nikolai Kosjar
Browse files

CppEditor: Tests: Remove superfluous reference to CppEditorSupport



Also remove the introduced functions in CppEditorSupport. We can just
wait until the document is "Full Checked" via Document::checkmode().

Change-Id: I31d23016f5aa5d3c37e8e05078436ab901bfb2d7
Reviewed-by: default avatarErik Verbruggen <erik.verbruggen@digia.com>
parent 7047cf01
......@@ -30,8 +30,6 @@
#include "cppeditor.h"
#include "cppeditorplugin.h"
#include <cpptools/cpptoolseditorsupport.h>
#include <utils/fileutils.h>
#include <QDebug>
......@@ -78,7 +76,6 @@ public:
, targetCursorPosition(source.indexOf('$'))
, editor(0)
, editorWidget(0)
, editorSupport(0)
{
QVERIFY(initialCursorPosition != targetCursorPosition);
if (initialCursorPosition > targetCursorPosition) {
......@@ -123,7 +120,6 @@ public:
CPPEditor *editor;
CPPEditorWidget *editorWidget;
CppEditorSupport *editorSupport;
};
/**
......@@ -213,14 +209,15 @@ void TestCase::init()
QVERIFY(testFile->editorWidget);
// Wait until the indexer processed the just opened file.
// The file is "Full Checked" (it's in the working copy now),
// The file is "Full Checked" since it is in the working copy now,
// that is the function bodies are processed.
CppModelManagerInterface *mmi = CppTools::CppModelManagerInterface::instance();
testFile->editorSupport = mmi->cppEditorSupport(testFile->editor);
QVERIFY(testFile->editorSupport);
while (testFile->editorSupport->isDocumentBeingUpdated()
|| testFile->editorSupport->isDocumentScheduledForUpdate()) {
QCoreApplication::processEvents();
forever {
Snapshot snapshot = CppTools::CppModelManagerInterface::instance()->snapshot();
if (Document::Ptr document = snapshot.document(testFile->filePath())) {
if (document->checkMode() == Document::FullCheck)
break;
QCoreApplication::processEvents();
}
}
// Rehighlight
......
......@@ -164,16 +164,6 @@ unsigned CppEditorSupport::editorRevision() const
return m_textEditor->editorWidget()->document()->revision();
}
bool CppEditorSupport::isDocumentBeingUpdated() const
{
return m_documentParser.isRunning();
}
bool CppEditorSupport::isDocumentScheduledForUpdate() const
{
return m_updateDocumentTimer->isActive();
}
void CppEditorSupport::setExtraDiagnostics(const QString &key,
const QList<Document::DiagnosticMessage> &messages)
{
......
......@@ -95,9 +95,6 @@ public:
QString contents() const;
unsigned editorRevision() const;
bool isDocumentBeingUpdated() const;
bool isDocumentScheduledForUpdate() const;
void setExtraDiagnostics(const QString &key,
const QList<CPlusPlus::Document::DiagnosticMessage> &messages);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment