handle MethodOrClosureScopeChooser selection in a write-safe context (EA-90852 -...
[idea/community.git] / plugins / groovy / src / org / jetbrains / plugins / groovy / refactoring / ui / MethodOrClosureScopeChooser.java
index c977bbe66d6147ce477244bba30871e79640bce4..5a1bfa1fd36312439752c43b79606eb4a7f180a7 100644 (file)
@@ -15,6 +15,7 @@
  */
 package org.jetbrains.plugins.groovy.refactoring.ui;
 
+import com.intellij.openapi.application.ModalityState;
 import com.intellij.openapi.diagnostic.Logger;
 import com.intellij.openapi.editor.Editor;
 import com.intellij.openapi.editor.colors.EditorColors;
@@ -151,7 +152,7 @@ public class MethodOrClosureScopeChooser {
           else {
             toSearchFor = superMethod.isEnabled() && superMethod.isSelected() ? ToSearchIn.getParent() : null;
           }
-          IdeFocusManager.findInstance().doWhenFocusSettlesDown(() -> callback.fun(ToSearchIn, toSearchFor));
+          IdeFocusManager.findInstance().doWhenFocusSettlesDown(() -> callback.fun(ToSearchIn, toSearchFor), ModalityState.current());
         }
       }, KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, 0)));