void (@NotNull AnAction action, @NotNull AnActionEvent event, @NotNull Runnable performRunnable) { Project project = event.getProject(); IndexNotReadyException indexError = null; ActionManagerEx manager = ActionManagerEx.getInstanceEx(); manager.fireBeforeActionPerformed(action, event); Component component = event.getData(PlatformCoreDataKeys.CONTEXT_COMPONENT); String actionId = StringUtil.notNullize( event.getActionManager().getId(action), action == InputEventDummyAction.INSTANCE ? performRunnable.getClass().getName() : action.getClass().getName()); if (component != null && !UIUtil.isShowing(component) && !ActionPlaces.TOUCHBAR_GENERAL.equals(event.getPlace()) && !Boolean.TRUE.equals(ClientProperty.get(component, ALLOW_ACTION_PERFORM_WHEN_HIDDEN))) { LOG.warn("Action is not performed because target component is not showing: " + "action=" + actionId + ", component=" + component.getClass().getName()); manager.fireAfterActionPerformed(action, event, AnActionResult.IGNORED); return; } AnActionResult result = null; try (AccessToken ignore = SlowOperations.startSection(SlowOperations.ACTION_PERFORM); AccessToken ignore2 = withActionThreadContext(actionId, event.getPlace(), event.getInputEvent(), component)) { performRunnable.run(); result = AnActionResult.PERFORMED; } catch (IndexNotReadyException ex) { indexError = ex; result = AnActionResult.failed(ex); } catch (RuntimeException | Error ex) { result = AnActionResult.failed(ex); throw ex; } finally { if (result == null) result = AnActionResult.failed(new Throwable()); manager.fireAfterActionPerformed(action, event, result); } if (indexError != null) { LOG.info(indexError); showDumbModeWarning(project, action, event); } }