dump.threads.on.empty.lookup(cherry picked from commit 3725f48)
authorpeter <peter@jetbrains.com>
Tue, 17 Jan 2012 16:57:18 +0000 (17:57 +0100)
committerpeter <peter@jetbrains.com>
Tue, 17 Jan 2012 16:57:53 +0000 (17:57 +0100)
platform/lang-impl/src/com/intellij/codeInsight/completion/CompletionProgressIndicator.java
platform/platform-resources-en/src/misc/registry.properties

index 876c3c6dfb144a807b87c9897ed012912789507a..2b81d90aa761ea1fba722cf094d09792430ea1da 100644 (file)
@@ -26,6 +26,7 @@ import com.intellij.codeInsight.hint.HintManager;
 import com.intellij.codeInsight.lookup.*;
 import com.intellij.codeInsight.lookup.impl.LookupImpl;
 import com.intellij.codeInsight.template.impl.LiveTemplateLookupElement;
+import com.intellij.diagnostic.PerformanceWatcher;
 import com.intellij.featureStatistics.FeatureUsageTracker;
 import com.intellij.injected.editor.DocumentWindow;
 import com.intellij.injected.editor.EditorWindow;
@@ -47,6 +48,7 @@ import com.intellij.openapi.util.Computable;
 import com.intellij.openapi.util.Disposer;
 import com.intellij.openapi.util.Pair;
 import com.intellij.openapi.util.TextRange;
+import com.intellij.openapi.util.registry.Registry;
 import com.intellij.openapi.util.text.StringUtil;
 import com.intellij.patterns.ElementPattern;
 import com.intellij.psi.PsiFile;
@@ -333,6 +335,10 @@ public class CompletionProgressIndicator extends ProgressIndicatorBase implement
         return false;
       }
 
+      if (Registry.is("dump.threads.on.empty.lookup") && myLookup.isCalculating() && myLookup.getItems().isEmpty()) {
+        PerformanceWatcher.getInstance().dumpThreads(true);
+      }
+
       if (StringUtil.isEmpty(myLookup.getAdvertisementText()) && !isAutopopupCompletion()) {
         final String text = DefaultCompletionContributor.getDefaultAdvertisementText(myParameters);
         if (text != null) {
index e3e162d663f3086c4f89355930b8fecbc611da7e..5cdf42338cff0d436dc5ae557da124546896f31d 100644 (file)
@@ -164,6 +164,9 @@ change.signature.awesome.mode.description=Enables list view for change signature
 
 enable.groovy.hotswap=true
 enable.groovy.hotswap.description=Whether IDEA should add a special java agent to the debugged process which allows to hot-swap Groovy changes in some cases
+dump.threads.on.empty.lookup=false
+dump.threads.on.empty.lookup.description=Whether IDEA should issue a thread dump when an empty completion lookup appears
+
 file.structure.tree.mode=true
 
 python.new.style.resolve=false
\ No newline at end of file