boolean (@NotNull AnAction action, @NotNull AnActionEvent e, boolean visibilityMatters) { Project project = e.getProject(); if (project != null && PerformWithDocumentsCommitted.isPerformWithDocumentsCommitted(action)) { try (AccessToken ignore = SlowOperations.startSection(SlowOperations.ACTION_PERFORM)) { PsiDocumentManager.getInstance(project).commitAllDocuments(); } } performDumbAwareUpdate(action, e, true); if (project != null && DumbService.getInstance(project).isDumb() && !action.isDumbAware()) { if (Boolean.FALSE.equals(e.getPresentation().getClientProperty(WOULD_BE_ENABLED_IF_NOT_DUMB_MODE))) { return false; } if (visibilityMatters && Boolean.FALSE.equals(e.getPresentation().getClientProperty(WOULD_BE_VISIBLE_IF_NOT_DUMB_MODE))) { return false; } showDumbModeWarning(project, action, e); return false; } if (!e.getPresentation().isEnabled()) { return false; } return !visibilityMatters || e.getPresentation().isVisible(); }