diagnostics for lookup disposed during typing (IDEA-136066)
authorpeter <peter@jetbrains.com>
Fri, 6 Feb 2015 13:59:48 +0000 (14:59 +0100)
committerpeter <peter@jetbrains.com>
Fri, 6 Feb 2015 15:11:11 +0000 (16:11 +0100)
platform/lang-impl/src/com/intellij/codeInsight/lookup/impl/LookupTypedHandler.java

index dd370f6dfe7ff38f2792beeede935a2cbcc7997c..e84667ebd4d09550500a38176545821536ae9265 100644 (file)
@@ -207,6 +207,7 @@ public class LookupTypedHandler extends TypedActionHandlerBase {
 
   @Nullable
   private static CharFilter.Result getFiltersDecision(char charTyped, LookupImpl lookup) {
+    lookup.checkValid();
     LookupElement item = lookup.getCurrentItem();
     int prefixLength = item == null ? lookup.getAdditionalPrefix().length(): lookup.itemPattern(item).length();
 
@@ -215,6 +216,9 @@ public class LookupTypedHandler extends TypedActionHandlerBase {
       if (result != null) {
         return result;
       }
+      if (lookup.isLookupDisposed()) {
+        throw new AssertionError("Lookup disposed after " + extension);
+      }
     }
     return null;
   }