Commit 7e7fb224 authored by Przemyslaw Gorszkowski's avatar Przemyslaw Gorszkowski Committed by Erik Verbruggen

AutoTests: fix test framework in case of tests for class members

Change-Id: I564ea9cccc24509957481b6726f25833f35a4da4
Reviewed-by: default avatarErik Verbruggen <erik.verbruggen@digia.com>
parent b143f4a3
......@@ -32,6 +32,7 @@
#include <texteditor/plaintexteditor.h>
#include <texteditor/codeassist/iassistproposal.h>
#include <texteditor/convenience.h>
#include <utils/changeset.h>
#include <utils/fileutils.h>
......@@ -76,6 +77,11 @@ static QStringList getCompletions(TestData &data, bool *replaceAccessOperator =
CppAssistProposalModel *listmodel = dynamic_cast<CppAssistProposalModel *>(model);
if (!listmodel)
return completions;
const int pos = proposal->basePosition();
const int length = data.pos - pos;
const QString prefix = Convenience::textAt(QTextCursor(data.editor->document()), pos, length);
if (!prefix.isEmpty())
listmodel->filter(prefix);
for (int i = 0; i < listmodel->size(); ++i)
completions << listmodel->text(i);
......
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