From bcd2bbcd7dfcf49dc581b92fc90f7b3f054b2508 Mon Sep 17 00:00:00 2001 From: peter Date: Mon, 31 Jan 2011 15:37:04 +0100 Subject: [PATCH] mark frozen items in dump weights action --- .../src/com/intellij/codeInsight/lookup/impl/LookupImpl.java | 4 ++++ .../src/com/intellij/internal/DumpLookupElementWeights.java | 5 ++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/platform/lang-impl/src/com/intellij/codeInsight/lookup/impl/LookupImpl.java b/platform/lang-impl/src/com/intellij/codeInsight/lookup/impl/LookupImpl.java index 7053e6e5e090..deb5975fb95a 100644 --- a/platform/lang-impl/src/com/intellij/codeInsight/lookup/impl/LookupImpl.java +++ b/platform/lang-impl/src/com/intellij/codeInsight/lookup/impl/LookupImpl.java @@ -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 firstItems, final Collection elements) { List sorted = new SortedList(new Comparator() { public int compare(LookupElement o1, LookupElement o2) { diff --git a/platform/lang-impl/src/com/intellij/internal/DumpLookupElementWeights.java b/platform/lang-impl/src/com/intellij/internal/DumpLookupElementWeights.java index 7fd253f3ea71..ccdd719181a4 100644 --- a/platform/lang-impl/src/com/intellij/internal/DumpLookupElementWeights.java +++ b/platform/lang-impl/src/com/intellij/internal/DumpLookupElementWeights.java @@ -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) {