Change CompletionLookupArranger API so that it actually works

Previously it always crashed at runtime.
This commit is contained in:
Dmitry Jemerov
2018-04-18 16:19:57 +02:00
parent db30681e70
commit 49875a9c61
2 changed files with 14 additions and 1 deletions
@@ -17,7 +17,10 @@ public interface CompletionLookupArranger {
* Adds an element to be arranged.
* @param presentation The presentation of the element (rendered with {@link LookupElement#renderElement(LookupElementPresentation)}
*/
void addElement(LookupElement element, LookupElementPresentation presentation);
void addElement(LookupElement element,
CompletionSorter sorter,
PrefixMatcher prefixMatcher,
LookupElementPresentation presentation);
/**
* Returns the items in the appropriate order and the initial selection.
@@ -136,6 +136,16 @@ public class CompletionLookupArrangerImpl extends LookupArranger implements Comp
return true;
}
@Override
public void addElement(LookupElement element,
CompletionSorter sorter,
PrefixMatcher prefixMatcher,
LookupElementPresentation presentation) {
registerMatcher(element, prefixMatcher);
associateSorter(element, (CompletionSorterImpl)sorter);
addElement(element, presentation);
}
@Override
public void addElement(LookupElement element, LookupElementPresentation presentation) {
StatisticsWeigher.clearBaseStatisticsInfo(element);