void (@NotNull AnAction action, @NotNull AnActionEvent event) { ApplicationManager.getApplication().invokeLater(() -> { if (context.isDisposed()) { Disposer.dispose(disposable); return; } if (targetAction.equals(action)) { context.message("Performed action: " + actionName, context.getCurrentLine()); Disposer.dispose(disposable); result.setDone(); } }, ModalityState.any()); }