calculate completionSorting weight outside EDT

This commit is contained in:
peter
2012-07-10 07:28:12 +02:00
parent 756c72c6ee
commit 55a3f2211d
@@ -33,6 +33,7 @@ import com.intellij.openapi.util.Disposer;
import com.intellij.openapi.util.Key;
import com.intellij.openapi.util.Pair;
import com.intellij.openapi.util.text.StringUtil;
import com.intellij.psi.WeighingComparable;
import com.intellij.psi.WeighingService;
import com.intellij.psi.statistics.StatisticsInfo;
import com.intellij.psi.statistics.StatisticsManager;
@@ -122,7 +123,9 @@ public class CompletionLookupArranger extends LookupArranger {
@Override
public void addElement(Lookup lookup, LookupElement element, LookupElementPresentation presentation) {
mySortingWeights.put(element, WeighingService.weigh(CompletionService.SORTING_KEY, element, myLocation));
WeighingComparable<LookupElement,CompletionLocation> w = WeighingService.weigh(CompletionService.SORTING_KEY, element, myLocation);
w.force();
mySortingWeights.put(element, w);
CompletionSorterImpl sorter = obtainSorter(element);
Classifier<LookupElement> classifier = myClassifiers.get(sorter);
if (classifier == null) {