forked from qt-creator/qt-creator
QuickFixes: Always show all matching quick fixes.
Change-Id: Ifc23d047b3b267ca1369ecb6f9f5de18887d3e92 Reviewed-on: http://codereview.qt.nokia.com/3250 Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
This commit is contained in:
@@ -72,12 +72,19 @@ IAssistProposal *QuickFixAssistProcessor::perform(const IAssistInterface *interf
|
|||||||
}
|
}
|
||||||
|
|
||||||
QList<QuickFixOperation::Ptr> quickFixes;
|
QList<QuickFixOperation::Ptr> quickFixes;
|
||||||
|
// ### As the list of quick fixes grows, introduce some way of only showing relevant ones.
|
||||||
|
// The old priority-based way where the priority is the matching ast-node depth does not
|
||||||
|
// work well.
|
||||||
|
foreach (const QList<QuickFixOperation::Ptr> &fixes, matchedOps)
|
||||||
|
quickFixes += fixes;
|
||||||
|
#if 0
|
||||||
QMapIterator<int, QList<QuickFixOperation::Ptr> > it(matchedOps);
|
QMapIterator<int, QList<QuickFixOperation::Ptr> > it(matchedOps);
|
||||||
it.toBack();
|
it.toBack();
|
||||||
if (it.hasPrevious()) {
|
if (it.hasPrevious()) {
|
||||||
it.previous();
|
it.previous();
|
||||||
quickFixes = it.value();
|
quickFixes = it.value();
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
if (!quickFixes.isEmpty()) {
|
if (!quickFixes.isEmpty()) {
|
||||||
QList<BasicProposalItem *> items;
|
QList<BasicProposalItem *> items;
|
||||||
|
Reference in New Issue
Block a user