forked from qt-creator/qt-creator
TextEditor: Introduce AssistProposalItemInterface
For unit test we need to break every dependency to the TextEditor Widget etc.. With an abstract interface we can implement it in clang without relying on unwanted dependencies. It makes it also easier to compute the values deferred. Change-Id: I1b313a1625f4e80bd324ab4bf1a7c4f6b690abe9 Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
This commit is contained in:
@@ -58,14 +58,14 @@ namespace ClangCodeModel {
|
||||
namespace Internal {
|
||||
|
||||
using ClangBackEnd::CodeCompletion;
|
||||
using TextEditor::AssistProposalItem;
|
||||
using TextEditor::AssistProposalItemInterface;
|
||||
|
||||
namespace {
|
||||
|
||||
const char SNIPPET_ICON_PATH[] = ":/texteditor/images/snippet.png";
|
||||
|
||||
|
||||
QList<AssistProposalItem *> toAssistProposalItems(const CodeCompletions &completions)
|
||||
QList<AssistProposalItemInterface *> toAssistProposalItems(const CodeCompletions &completions)
|
||||
{
|
||||
static CPlusPlus::Icons m_icons; // de-deduplicate
|
||||
|
||||
@@ -178,7 +178,7 @@ QList<AssistProposalItem *> toAssistProposalItems(const CodeCompletions &complet
|
||||
}
|
||||
}
|
||||
|
||||
QList<AssistProposalItem *> results;
|
||||
QList<AssistProposalItemInterface *> results;
|
||||
results.reserve(items.size());
|
||||
std::copy(items.cbegin(), items.cend(), std::back_inserter(results));
|
||||
|
||||
|
Reference in New Issue
Block a user