diff --git a/plugins/groovy/src/org/jetbrains/plugins/groovy/dsl/GroovyDslFileIndex.java b/plugins/groovy/src/org/jetbrains/plugins/groovy/dsl/GroovyDslFileIndex.java index e01f4bb79efc..22af2f110ecd 100644 --- a/plugins/groovy/src/org/jetbrains/plugins/groovy/dsl/GroovyDslFileIndex.java +++ b/plugins/groovy/src/org/jetbrains/plugins/groovy/dsl/GroovyDslFileIndex.java @@ -307,8 +307,14 @@ public class GroovyDslFileIndex extends ScalarIndexExtension { } } + private static boolean stopGdsl = false; + @Nullable private static GroovyDslExecutor createExecutor(String text, VirtualFile vfile, final Project project) { + if (stopGdsl) { + return null; + } + try { return new GroovyDslExecutor(text, vfile.getName()); } @@ -323,6 +329,16 @@ public class GroovyDslFileIndex extends ScalarIndexExtension { return null; } invokeDslErrorPopup(e, project, vfile); + + if (e instanceof OutOfMemoryError) { + stopGdsl = true; + throw (Error)e; + } + if (e instanceof NoClassDefFoundError) { + stopGdsl = true; + throw (NoClassDefFoundError) e; + } + return null; } } @@ -330,6 +346,7 @@ public class GroovyDslFileIndex extends ScalarIndexExtension { if (!isActivated(vfile)) { return; } + disableFile(vfile); final StringWriter writer = new StringWriter(); //noinspection IOResourceOpenedButNotSafelyClosed @@ -349,8 +366,6 @@ public class GroovyDslFileIndex extends ScalarIndexExtension { notification.expire(); } })); - - disableFile(vfile); } }