Commit 0edefc4c authored by hjk's avatar hjk

TextEditor: Merge some "assist" related classes

Simplifies the code base by removing one level of unused
and unneeded abstraction.

- Merge {I,Default}AssistInterface to AssistInterface
- Merge {IAssist,Basic}ProposalItem to AssistProposalItem
- Merge {IGenericProposal,BasicProposalItemList}Model to GenericProposalModel

Change-Id: I54ee7b095427383d67a00fc1d87c3808c21d812d
Reviewed-by: default avatarNikolai Kosjar <nikolai.kosjar@digia.com>
parent 0c3eeab4
......@@ -48,8 +48,8 @@
#include <texteditor/basetexteditor.h>
#include <texteditor/convenience.h>
#include <texteditor/codeassist/basicproposalitemlistmodel.h>
#include <texteditor/codeassist/basicproposalitem.h>
#include <texteditor/codeassist/genericproposalmodel.h>
#include <texteditor/codeassist/assistproposalitem.h>
#include <texteditor/codeassist/functionhintproposal.h>
#include <texteditor/codeassist/genericproposal.h>
#include <texteditor/codeassist/ifunctionhintproposalmodel.h>
......@@ -202,7 +202,7 @@ IAssistProcessor *ClangCompletionAssistProvider::createProcessor() const
return new ClangCompletionAssistProcessor;
}
IAssistInterface *ClangCompletionAssistProvider::createAssistInterface(
AssistInterface *ClangCompletionAssistProvider::createAssistInterface(
const QString &filePath,
QTextDocument *document, bool isObjCEnabled, int position, AssistReason reason) const
{
......@@ -235,11 +235,11 @@ IAssistInterface *ClangCompletionAssistProvider::createAssistInterface(
// ------------------------
// ClangAssistProposalModel
// ------------------------
class ClangAssistProposalModel : public TextEditor::BasicProposalItemListModel
class ClangAssistProposalModel : public TextEditor::GenericProposalModel
{
public:
ClangAssistProposalModel()
: TextEditor::BasicProposalItemListModel()
: TextEditor::GenericProposalModel()
, m_sortable(false)
, m_completionOperator(T_EOF_SYMBOL)
, m_replaceDotForArrow(false)
......@@ -257,7 +257,7 @@ public:
class ClangAssistProposal : public TextEditor::GenericProposal
{
public:
ClangAssistProposal(int cursorPos, TextEditor::IGenericProposalModel *model)
ClangAssistProposal(int cursorPos, TextEditor::GenericProposalModel *model)
: TextEditor::GenericProposal(cursorPos, model)
, m_replaceDotForArrow(static_cast<ClangAssistProposalModel *>(model)->m_replaceDotForArrow)
{}
......@@ -345,7 +345,7 @@ int ClangFunctionHintModel::activeArgument(const QString &prefix) const
return argnr;
}
class ClangAssistProposalItem : public TextEditor::BasicProposalItem
class ClangAssistProposalItem : public TextEditor::AssistProposalItem
{
public:
ClangAssistProposalItem() {}
......@@ -550,7 +550,7 @@ ClangCompletionAssistInterface::ClangCompletionAssistInterface(ClangCompleter::P
const QStringList &options,
const QList<CppTools::ProjectPart::HeaderPath> &headerPaths,
const PchInfo::Ptr &pchInfo)
: DefaultAssistInterface(document, position, fileName, reason)
: AssistInterface(document, position, fileName, reason)
, m_clangWrapper(clangWrapper)
, m_options(options)
, m_headerPaths(headerPaths)
......@@ -602,7 +602,7 @@ ClangCompletionAssistProcessor::~ClangCompletionAssistProcessor()
{
}
IAssistProposal *ClangCompletionAssistProcessor::perform(const IAssistInterface *interface)
IAssistProposal *ClangCompletionAssistProcessor::perform(const AssistInterface *interface)
{
m_interface.reset(static_cast<const ClangCompletionAssistInterface *>(interface));
......
......@@ -37,9 +37,9 @@
#include <cpptools/cppcompletionassistprovider.h>
#include <cpptools/cppmodelmanagerinterface.h>
#include <texteditor/codeassist/basicproposalitem.h>
#include <texteditor/codeassist/assistproposalitem.h>
#include <texteditor/codeassist/completionassistprovider.h>
#include <texteditor/codeassist/defaultassistinterface.h>
#include <texteditor/codeassist/assistinterface.h>
#include <texteditor/codeassist/iassistprocessor.h>
#include <QStringList>
......@@ -56,7 +56,7 @@ public:
ClangCompletionAssistProvider();
virtual TextEditor::IAssistProcessor *createProcessor() const;
virtual TextEditor::IAssistInterface *createAssistInterface(
virtual TextEditor::AssistInterface *createAssistInterface(
const QString &filePath,
QTextDocument *document, bool isObjCEnabled, int position,
TextEditor::AssistReason reason) const;
......@@ -67,7 +67,7 @@ private:
} // namespace Internal
class CLANG_EXPORT ClangCompletionAssistInterface: public TextEditor::DefaultAssistInterface
class CLANG_EXPORT ClangCompletionAssistInterface: public TextEditor::AssistInterface
{
public:
ClangCompletionAssistInterface(ClangCodeModel::ClangCompleter::Ptr clangWrapper,
......@@ -109,7 +109,7 @@ public:
ClangCompletionAssistProcessor();
virtual ~ClangCompletionAssistProcessor();
virtual TextEditor::IAssistProposal *perform(const TextEditor::IAssistInterface *interface);
virtual TextEditor::IAssistProposal *perform(const TextEditor::AssistInterface *interface);
private:
int startCompletionHelper();
......@@ -133,7 +133,7 @@ private:
private:
int m_startPosition;
QScopedPointer<const ClangCompletionAssistInterface> m_interface;
QList<TextEditor::BasicProposalItem *> m_completions;
QList<TextEditor::AssistProposalItem *> m_completions;
CPlusPlus::Icons m_icons;
QStringList m_preprocessorCompletions;
QScopedPointer<Internal::ClangAssistProposalModel> m_model;
......
......@@ -39,8 +39,7 @@
#include <texteditor/basetextdocument.h>
#include <texteditor/basetexteditor.h>
#include <texteditor/codeassist/iassistproposal.h>
#include <texteditor/codeassist/iassistproposalmodel.h>
#include <texteditor/codeassist/basicproposalitemlistmodel.h>
#include <texteditor/codeassist/genericproposalmodel.h>
#include <utils/fileutils.h>
#include <utils/changeset.h>
......
......@@ -62,8 +62,8 @@
#include <texteditor/basetextdocument.h>
#include <texteditor/basetextdocumentlayout.h>
#include <texteditor/codeassist/basicproposalitem.h>
#include <texteditor/codeassist/basicproposalitemlistmodel.h>
#include <texteditor/codeassist/assistproposalitem.h>
#include <texteditor/codeassist/genericproposalmodel.h>
#include <texteditor/codeassist/genericproposal.h>
#include <texteditor/fontsettings.h>
#include <texteditor/refactoroverlay.h>
......@@ -498,15 +498,15 @@ void CppEditorWidget::contextMenuEvent(QContextMenuEvent *e)
QSignalMapper mapper;
connect(&mapper, SIGNAL(mapped(int)), this, SLOT(performQuickFix(int)));
if (isSemanticInfoValid()) {
IAssistInterface *interface = createAssistInterface(QuickFix, ExplicitlyInvoked);
AssistInterface *interface = createAssistInterface(QuickFix, ExplicitlyInvoked);
if (interface) {
QScopedPointer<IAssistProcessor> processor(
CppEditorPlugin::instance()->quickFixProvider()->createProcessor());
QScopedPointer<IAssistProposal> proposal(processor->perform(interface));
if (!proposal.isNull()) {
auto model = static_cast<BasicProposalItemListModel *>(proposal->model());
auto model = static_cast<GenericProposalModel *>(proposal->model());
for (int index = 0; index < model->size(); ++index) {
auto item = static_cast<BasicProposalItem *>(model->proposalItem(index));
auto item = static_cast<AssistProposalItem *>(model->proposalItem(index));
QuickFixOperation::Ptr op = item->data().value<QuickFixOperation::Ptr>();
d->m_quickFixes.append(op);
QAction *action = quickFixMenu->addAction(op->description());
......@@ -610,7 +610,7 @@ void CppEditorWidget::updateSemanticInfo(const SemanticInfo &semanticInfo,
updateFunctionDeclDefLink();
}
IAssistInterface *CppEditorWidget::createAssistInterface(AssistKind kind, AssistReason reason) const
AssistInterface *CppEditorWidget::createAssistInterface(AssistKind kind, AssistReason reason) const
{
if (kind == Completion) {
if (CppCompletionAssistProvider *cap = cppEditorDocument()->completionAssistProvider()) {
......
......@@ -79,7 +79,7 @@ public:
QSharedPointer<FunctionDeclDefLink> declDefLink() const;
void applyDeclDefLinkChanges(bool jumpToMatch);
TextEditor::IAssistInterface *createAssistInterface(
TextEditor::AssistInterface *createAssistInterface(
TextEditor::AssistKind kind,
TextEditor::AssistReason reason) const QTC_OVERRIDE;
......
......@@ -87,8 +87,8 @@ const IAssistProvider *CppQuickFixAssistProcessor::provider() const
// --------------------------
CppQuickFixAssistInterface::CppQuickFixAssistInterface(CppEditorWidget *editor,
TextEditor::AssistReason reason)
: DefaultAssistInterface(editor->document(), editor->position(),
editor->textDocument()->filePath(), reason)
: AssistInterface(editor->document(), editor->position(),
editor->textDocument()->filePath(), reason)
, m_editor(editor)
, m_semanticInfo(editor->semanticInfo())
, m_snapshot(CppTools::CppModelManagerInterface::instance()->snapshot())
......
......@@ -31,7 +31,7 @@
#define CPPQUICKFIXASSISTANT_H
#include <cpptools/cppsemanticinfo.h>
#include <texteditor/codeassist/defaultassistinterface.h>
#include <texteditor/codeassist/assistinterface.h>
#include <texteditor/codeassist/quickfixassistprovider.h>
#include <texteditor/codeassist/quickfixassistprocessor.h>
......@@ -49,7 +49,7 @@ namespace Internal {
class CppEditorWidget;
class CppQuickFixAssistInterface : public TextEditor::DefaultAssistInterface
class CppQuickFixAssistInterface : public TextEditor::AssistInterface
{
public:
CppQuickFixAssistInterface(CppEditorWidget *editor, TextEditor::AssistReason reason);
......
......@@ -44,10 +44,10 @@
#include <cpptools/symbolfinder.h>
#include <cpptools/typehierarchybuilder.h>
#include <texteditor/codeassist/basicproposalitemlistmodel.h>
#include <texteditor/codeassist/genericproposalmodel.h>
#include <texteditor/codeassist/genericproposal.h>
#include <texteditor/codeassist/genericproposalwidget.h>
#include <texteditor/codeassist/iassistinterface.h>
#include <texteditor/codeassist/assistinterface.h>
#include <texteditor/codeassist/iassistprocessor.h>
#include <texteditor/codeassist/iassistproposal.h>
#include <texteditor/texteditorconstants.h>
......@@ -91,7 +91,7 @@ protected:
void showProposal(const QString &prefix) QTC_OVERRIDE
{
IGenericProposalModel *proposalModel = model();
GenericProposalModel *proposalModel = model();
if (proposalModel && proposalModel->size() == 1) {
emit proposalItemActivated(proposalModel->proposalItem(0));
deleteLater();
......@@ -107,7 +107,7 @@ private:
class VirtualFunctionProposal : public GenericProposal
{
public:
VirtualFunctionProposal(int cursorPos, IGenericProposalModel *model, bool openInSplit)
VirtualFunctionProposal(int cursorPos, GenericProposalModel *model, bool openInSplit)
: GenericProposal(cursorPos, model)
, m_openInSplit(openInSplit)
{}
......@@ -128,24 +128,24 @@ public:
: m_params(params)
{}
IAssistProposal *immediateProposal(const TextEditor::IAssistInterface *) QTC_OVERRIDE
IAssistProposal *immediateProposal(const TextEditor::AssistInterface *) QTC_OVERRIDE
{
QTC_ASSERT(m_params.function, return 0);
BasicProposalItem *hintItem = new VirtualFunctionProposalItem(CppEditorWidget::Link());
AssistProposalItem *hintItem = new VirtualFunctionProposalItem(CppEditorWidget::Link());
hintItem->setText(QCoreApplication::translate("VirtualFunctionsAssistProcessor",
"...searching overrides"));
hintItem->setOrder(-1000);
QList<BasicProposalItem *> items;
QList<AssistProposalItem *> items;
items << itemFromFunction(m_params.function);
items << hintItem;
return new VirtualFunctionProposal(m_params.cursorPosition,
new BasicProposalItemListModel(items),
new GenericProposalModel(items),
m_params.openInNextSplit);
}
IAssistProposal *perform(const IAssistInterface *) QTC_OVERRIDE
IAssistProposal *perform(const AssistInterface *) QTC_OVERRIDE
{
QTC_ASSERT(m_params.function, return 0);
QTC_ASSERT(m_params.staticClass, return 0);
......@@ -161,13 +161,13 @@ public:
if (overrides.isEmpty())
return 0;
QList<BasicProposalItem *> items;
QList<AssistProposalItem *> items;
foreach (Function *func, overrides)
items << itemFromFunction(func);
items.first()->setOrder(1000); // Ensure top position for function of static type
return new VirtualFunctionProposal(m_params.cursorPosition,
new BasicProposalItemListModel(items),
new GenericProposalModel(items),
m_params.openInNextSplit);
}
......@@ -179,14 +179,14 @@ private:
return func;
}
BasicProposalItem *itemFromFunction(Function *func) const
AssistProposalItem *itemFromFunction(Function *func) const
{
const CppEditorWidget::Link link = CppEditorWidget::linkToSymbol(maybeDefinitionFor(func));
QString text = m_overview.prettyName(LookupContext::fullyQualifiedName(func));
if (func->isPureVirtual())
text += QLatin1String(" = 0");
BasicProposalItem *item = new VirtualFunctionProposalItem(link, m_params.openInNextSplit);
AssistProposalItem *item = new VirtualFunctionProposalItem(link, m_params.openInNextSplit);
item->setText(text);
item->setIcon(m_icons.iconForSymbol(func));
......
......@@ -31,12 +31,13 @@
#define CPPVIRTUALFUNCTIONPROPOSALITEM_H
#include <texteditor/basetexteditor.h>
#include <texteditor/codeassist/basicproposalitem.h>
#include <texteditor/codeassist/assistproposalitem.h>
namespace CppEditor {
namespace Internal {
class VirtualFunctionProposalItem: public TextEditor::BasicProposalItem {
class VirtualFunctionProposalItem: public TextEditor::AssistProposalItem
{
public:
VirtualFunctionProposalItem(const TextEditor::BaseTextEditorWidget::Link &link,
bool openInSplit = true);
......
......@@ -34,7 +34,7 @@
#include "cppvirtualfunctionassistprovider.h"
#include "cppvirtualfunctionproposalitem.h"
#include <texteditor/codeassist/basicproposalitemlistmodel.h>
#include <texteditor/codeassist/genericproposalmodel.h>
#include <texteditor/codeassist/iassistprocessor.h>
#include <texteditor/codeassist/iassistproposal.h>
......@@ -124,7 +124,7 @@ public:
VirtualFunctionAssistProvider::configure(params);
IAssistProcessor *processor = createProcessor();
IAssistInterface *assistInterface
AssistInterface *assistInterface
= m_editorWidget->createAssistInterface(FollowSymbol, ExplicitlyInvoked);
IAssistProposal *immediateProposal = processor->immediateProposal(assistInterface);
IAssistProposal *finalProposal = processor->perform(assistInterface);
......@@ -140,7 +140,7 @@ public:
static OverrideItemList itemList(IAssistProposalModel *imodel)
{
OverrideItemList result;
BasicProposalItemListModel *model = dynamic_cast<BasicProposalItemListModel *>(imodel);
GenericProposalModel *model = dynamic_cast<GenericProposalModel *>(imodel);
if (!model)
return result;
......
......@@ -39,7 +39,7 @@
#include <coreplugin/icore.h>
#include <cppeditor/cppeditorconstants.h>
#include <texteditor/codeassist/basicproposalitem.h>
#include <texteditor/codeassist/assistproposalitem.h>
#include <texteditor/codeassist/genericproposal.h>
#include <texteditor/codeassist/ifunctionhintproposalmodel.h>
#include <texteditor/codeassist/functionhintproposal.h>
......@@ -84,7 +84,7 @@ struct CompleteFunctionDeclaration
// ---------------------
// CppAssistProposalItem
// ---------------------
class CppAssistProposalItem : public BasicProposalItem
class CppAssistProposalItem : public AssistProposalItem
{
public:
CppAssistProposalItem() :
......@@ -119,9 +119,9 @@ bool CppAssistProposalModel::isSortable(const QString &prefix) const
return !prefix.isEmpty();
}
IAssistProposalItem *CppAssistProposalModel::proposalItem(int index) const
AssistProposalItem *CppAssistProposalModel::proposalItem(int index) const
{
auto item = static_cast<BasicProposalItem *>(BasicProposalItemListModel::proposalItem(index));
auto item = static_cast<AssistProposalItem *>(GenericProposalModel::proposalItem(index));
if (!item->data().canConvert<QString>()) {
CppAssistProposalItem *cppItem = static_cast<CppAssistProposalItem *>(item);
cppItem->keepCompletionOperator(m_completionOperator);
......@@ -416,7 +416,7 @@ IAssistProcessor *InternalCompletionAssistProvider::createProcessor() const
return new CppCompletionAssistProcessor;
}
IAssistInterface *InternalCompletionAssistProvider::createAssistInterface(
AssistInterface *InternalCompletionAssistProvider::createAssistInterface(
const QString &filePath, QTextDocument *document,
bool isObjCEnabled, int position, AssistReason reason) const
{
......@@ -434,7 +434,7 @@ IAssistInterface *InternalCompletionAssistProvider::createAssistInterface(
class CppAssistProposal : public GenericProposal
{
public:
CppAssistProposal(int cursorPos, IGenericProposalModel *model)
CppAssistProposal(int cursorPos, GenericProposalModel *model)
: GenericProposal(cursorPos, model)
, m_replaceDotForArrow(static_cast<CppAssistProposalModel *>(model)->m_replaceDotForArrow)
{}
......@@ -460,7 +460,7 @@ namespace {
class ConvertToCompletionItem: protected NameVisitor
{
// The completion item.
BasicProposalItem *_item;
AssistProposalItem *_item;
// The current symbol.
Symbol *_symbol;
......@@ -477,14 +477,14 @@ public:
overview.showArgumentNames = true;
}
BasicProposalItem *operator()(Symbol *symbol)
AssistProposalItem *operator()(Symbol *symbol)
{
//using declaration can be qualified
if (!symbol || !symbol->name() || (symbol->name()->isQualifiedNameId()
&& !symbol->asUsingDeclaration()))
return 0;
BasicProposalItem *previousItem = switchCompletionItem(0);
AssistProposalItem *previousItem = switchCompletionItem(0);
Symbol *previousSymbol = switchSymbol(symbol);
accept(symbol->unqualifiedName());
if (_item)
......@@ -501,16 +501,16 @@ protected:
return previousSymbol;
}
BasicProposalItem *switchCompletionItem(BasicProposalItem *item)
AssistProposalItem *switchCompletionItem(AssistProposalItem *item)
{
BasicProposalItem *previousItem = _item;
AssistProposalItem *previousItem = _item;
_item = item;
return previousItem;
}
BasicProposalItem *newCompletionItem(const Name *name)
AssistProposalItem *newCompletionItem(const Name *name)
{
BasicProposalItem *item = new CppAssistProposalItem;
AssistProposalItem *item = new CppAssistProposalItem;
item->setText(overview.prettyName(name));
return item;
}
......@@ -631,7 +631,7 @@ CppCompletionAssistProcessor::CppCompletionAssistProcessor()
CppCompletionAssistProcessor::~CppCompletionAssistProcessor()
{}
IAssistProposal * CppCompletionAssistProcessor::perform(const IAssistInterface *interface)
IAssistProposal * CppCompletionAssistProcessor::perform(const AssistInterface *interface)
{
m_interface.reset(static_cast<const CppCompletionAssistInterface *>(interface));
......@@ -719,7 +719,7 @@ IAssistProposal *CppCompletionAssistProcessor::createContentProposal()
{
// Duplicates are kept only if they are snippets.
QSet<QString> processed;
QList<BasicProposalItem *>::iterator it = m_completions.begin();
QList<AssistProposalItem *>::iterator it = m_completions.begin();
while (it != m_completions.end()) {
CppAssistProposalItem *item = static_cast<CppAssistProposalItem *>(*it);
if (!processed.contains(item->text()) || item->data().canConvert<QString>()) {
......@@ -1047,7 +1047,7 @@ void CppCompletionAssistProcessor::addCompletionItem(const QString &text,
int order,
const QVariant &data)
{
BasicProposalItem *item = new CppAssistProposalItem;
AssistProposalItem *item = new CppAssistProposalItem;
item->setText(text);
item->setIcon(icon);
item->setOrder(order);
......@@ -1059,7 +1059,7 @@ void CppCompletionAssistProcessor::addCompletionItem(CPlusPlus::Symbol *symbol,
int order)
{
ConvertToCompletionItem toCompletionItem;
BasicProposalItem *item = toCompletionItem(symbol);
AssistProposalItem *item = toCompletionItem(symbol);
if (item) {
item->setIcon(m_icons.iconForSymbol(symbol));
item->setOrder(order);
......@@ -1680,7 +1680,7 @@ bool CppCompletionAssistProcessor::completeQtMethod(const QList<CPlusPlus::Looku
signature = QString::fromUtf8(normalized, normalized.size());
if (!signatures.contains(signature)) {
BasicProposalItem *ci = toCompletionItem(fun);
AssistProposalItem *ci = toCompletionItem(fun);
if (!ci)
break;
signatures.insert(signature);
......
......@@ -39,8 +39,8 @@
#include <cplusplus/TypeOfExpression.h>
#include <texteditor/basetexteditor.h>
#include <texteditor/codeassist/basicproposalitemlistmodel.h>
#include <texteditor/codeassist/defaultassistinterface.h>
#include <texteditor/codeassist/genericproposalmodel.h>
#include <texteditor/codeassist/assistinterface.h>
#include <texteditor/codeassist/iassistprocessor.h>
#include <texteditor/snippets/snippetassistcollector.h>
......@@ -49,10 +49,6 @@
#include <QStringList>
#include <QVariant>
QT_BEGIN_NAMESPACE
class QTextCursor;
QT_END_NAMESPACE
namespace CPlusPlus {
class LookupItem;
class ClassOrNamespace;
......@@ -65,11 +61,11 @@ namespace Internal {
class CppCompletionAssistInterface;
class CppAssistProposalModel : public TextEditor::BasicProposalItemListModel
class CppAssistProposalModel : public TextEditor::GenericProposalModel
{
public:
CppAssistProposalModel()
: TextEditor::BasicProposalItemListModel()
: TextEditor::GenericProposalModel()
, m_completionOperator(CPlusPlus::T_EOF_SYMBOL)
, m_replaceDotForArrow(false)
, m_typeOfExpression(new CPlusPlus::TypeOfExpression)
......@@ -78,7 +74,7 @@ public:
}
bool isSortable(const QString &prefix) const QTC_OVERRIDE;
TextEditor::IAssistProposalItem *proposalItem(int index) const QTC_OVERRIDE;
TextEditor::AssistProposalItem *proposalItem(int index) const QTC_OVERRIDE;
unsigned m_completionOperator;
bool m_replaceDotForArrow;
......@@ -92,7 +88,7 @@ class InternalCompletionAssistProvider : public CppCompletionAssistProvider
public:
TextEditor::IAssistProcessor *createProcessor() const QTC_OVERRIDE;
TextEditor::IAssistInterface *createAssistInterface(
TextEditor::AssistInterface *createAssistInterface(
const QString &filePath,
QTextDocument *document,
bool isObjCEnabled,
......@@ -106,7 +102,7 @@ public:
CppCompletionAssistProcessor();
~CppCompletionAssistProcessor();
TextEditor::IAssistProposal *perform(const TextEditor::IAssistInterface *interface) QTC_OVERRIDE;
TextEditor::IAssistProposal *perform(const TextEditor::AssistInterface *interface) QTC_OVERRIDE;
private:
TextEditor::IAssistProposal *createContentProposal();
......@@ -159,7 +155,7 @@ private:
int m_startPosition;
CPlusPlus::LanguageFeatures m_languageFeatures;
QScopedPointer<const CppCompletionAssistInterface> m_interface;
QList<TextEditor::BasicProposalItem *> m_completions;
QList<TextEditor::AssistProposalItem *> m_completions;
TextEditor::SnippetAssistCollector m_snippetCollector;
CPlusPlus::Icons m_icons;
QStringList preprocessorCompletions;
......@@ -167,7 +163,7 @@ private:
TextEditor::IAssistProposal *m_hintProposal;
};
class CppCompletionAssistInterface : public TextEditor::DefaultAssistInterface
class CppCompletionAssistInterface : public TextEditor::AssistInterface
{
public:
CppCompletionAssistInterface(const QString &filePath,
......@@ -176,7 +172,7 @@ public:
int position,
TextEditor::AssistReason reason,
const WorkingCopy &workingCopy)
: TextEditor::DefaultAssistInterface(textDocument, position, filePath, reason)
: TextEditor::AssistInterface(textDocument, position, filePath, reason)
, m_isObjCEnabled(isObjCEnabled)
, m_gotCppSpecifics(false)
, m_workingCopy(workingCopy)
......@@ -188,7 +184,7 @@ public:
TextEditor::AssistReason reason,
const CPlusPlus::Snapshot &snapshot,
const ProjectPart::HeaderPaths &headerPaths)
: TextEditor::DefaultAssistInterface(textDocument, position, filePath, reason)
: TextEditor::AssistInterface(textDocument, position, filePath, reason)
, m_isObjCEnabled(false)
, m_gotCppSpecifics(true)
, m_snapshot(snapshot)
......
......@@ -43,7 +43,7 @@ QT_END_NAMESPACE
namespace TextEditor {
class BaseTextEditor;
class IAssistInterface;
class AssistInterface;
}
namespace CppTools {
......@@ -58,7 +58,7 @@ public:
bool isActivationCharSequence(const QString &sequence) const QTC_OVERRIDE;
bool isContinuationChar(const QChar &c) const QTC_OVERRIDE;
virtual TextEditor::IAssistInterface *createAssistInterface(
virtual TextEditor::AssistInterface *createAssistInterface(
const QString &filePath,
QTextDocument *document, bool isObjCEnabled, int position,
TextEditor::AssistReason reason) const = 0;
......
......@@ -65,11 +65,11 @@
#include <texteditor/icodestylepreferences.h>
#include <texteditor/texteditorsettings.h>
#include <texteditor/indenter.h>
#include <texteditor/codeassist/basicproposalitem.h>
#include <texteditor/codeassist/basicproposalitemlistmodel.h>
#include <texteditor/codeassist/assistproposalitem.h>
#include <texteditor/codeassist/genericproposalmodel.h>
#include <texteditor/codeassist/completionassistprovider.h>
#include <texteditor/codeassist/iassistprocessor.h>
#include <texteditor/codeassist/iassistinterface.h>
#include <texteditor/codeassist/assistinterface.h>
#include <texteditor/codeassist/genericproposal.h>
#include <utils/fancylineedit.h>
......@@ -881,7 +881,7 @@ private:
QString m_needle;
};
class FakeVimAssistProposalItem : public BasicProposalItem
class FakeVimAssistProposalItem : public AssistProposalItem
{
public:
FakeVimAssistProposalItem(const FakeVimCompletionAssistProvider *provider)
......@@ -911,11 +911,11 @@ private:
};
class FakeVimAssistProposalModel : public BasicProposalItemListModel
class FakeVimAssistProposalModel : public GenericProposalModel
{
public:
FakeVimAssistProposalModel(const QList<BasicProposalItem *> &items)
: BasicProposalItemListModel(items)
FakeVimAssistProposalModel(const QList<AssistProposalItem *> &items)
: GenericProposalModel(items)
{}
bool supportsPrefixExpansion() const QTC_OVERRIDE
......@@ -931,7 +931,7 @@ public:
: m_provider(static_cast<const FakeVimCompletionAssistProvider *>(provider))
{}
IAssistProposal *perform(const IAssistInterface *interface) QTC_OVERRIDE
IAssistProposal *perform(const AssistInterface *interface) QTC_OVERRIDE
{
const QString &needle = m_provider->needle();
......@@ -941,7 +941,7 @@ public:
tc.setPosition(interface->position());
tc.movePosition(QTextCursor::Start, QTextCursor::MoveAnchor);
QList<BasicProposalItem *> items;
QList<AssistProposalItem *> items;
QSet<QString> seen;
QTextDocument::FindFlags flags = QTextDocument::FindCaseSensitively;
while (1) {
......@@ -956,7 +956,7 @@ public:
&& !seen.contains(found)
&& sel.anchor() != basePosition) {
seen.insert(found);
BasicProposalItem *item = new FakeVimAssistProposalItem(m_provider);
AssistProposalItem *item = new FakeVimAssistProposalItem(m_provider);
item->setText(found);
items.append(item);
}
......
......@@ -40,8 +40,8 @@
#include <coreplugin/idocument.h>
#include <texteditor/completionsettings.h>
#include <texteditor/codeassist/basicproposalitem.h>
#include <texteditor/codeassist/basicproposalitemlistmodel.h>
#include <texteditor/codeassist/assistproposalitem.h>
#include <texteditor/codeassist/genericproposalmodel.h>
#include <texteditor/codeassist/genericproposal.h>
#include <texteditor/codeassist/functionhintproposal.h>
#include <cplusplus/ExpressionUnderCursor.h>
......@@ -242,7 +242,7 @@ GlslCompletionAssistProcessor::GlslCompletionAssistProcessor()
GlslCompletionAssistProcessor::~GlslCompletionAssistProcessor()
{}
IAssistProposal *GlslCompletionAssistProcessor::perform(const IAssistInterface *interface)
IAssistProposal *GlslCompletionAssistProcessor::perform(const AssistInterface *interface)
{
m_interface.reset(static_cast<const GlslCompletionAssistInterface *>(interface));
......@@ -432,7 +432,7 @@ IAssistProposal *GlslCompletionAssistProcessor::perform(const IAssistInterface *
IAssistProposal *GlslCompletionAssistProcessor::createContentProposal() const
{
IGenericProposalModel *model = new BasicProposalItemListModel(m_completions);
GenericProposalModel *model = new GenericProposalModel(m_completions);