mark frozen items in dump weights action

This commit is contained in:
peter
2011-01-31 16:54:47 +01:00
parent 915fa681a0
commit bcd2bbcd7d
2 changed files with 8 additions and 1 deletions
@@ -458,6 +458,10 @@ public class LookupImpl extends LightweightHint implements Lookup, Disposable {
}
}
public boolean isFrozen(@NotNull LookupElement element) {
return myFrozenItems.contains(element);
}
private boolean addExactPrefixItems(DefaultListModel model, Set<LookupElement> firstItems, final Collection<LookupElement> elements) {
List<LookupElement> sorted = new SortedList<LookupElement>(new Comparator<LookupElement>() {
public int compare(LookupElement o1, LookupElement o2) {
@@ -82,7 +82,10 @@ public class DumpLookupElementWeights extends AnAction implements DumbAware {
for (String s : toExclude) {
weight = StringUtil.replace(weight, s, "", false);
}
final String s = item.getLookupString() + weight;
while (weight.contains(", ,")) {
weight = weight.replaceAll(", ,", ",");
}
final String s = item.getLookupString() + (lookup.isFrozen(item) ? "\t_first_\t" : "\t") + weight;
System.out.println(s);
LOG.info(s);
if (i == count - 1) {