static <T extends ActionUpdateThreadAware> void updateWithProvider(@NotNull AnActionEvent event,
                                                                     @Nullable T provider,
                                                                     boolean checkDumbAwareness,
                                                                     @NotNull Consumer<T> consumer) {
    Project project = event.getData(CommonDataKeys.PROJECT);
    if (provider == null ||
        (checkDumbAwareness && project != null && !DumbService.getInstance(project).isUsableInCurrentContext(provider))) {
      event.getPresentation().setEnabled(false);
      event.getPresentation().setVisible(true);
      return;
    }
    ActionUpdateThread updateThread = provider.getActionUpdateThread();
    if (updateThread == ActionUpdateThread.BGT || EDT.isCurrentThreadEdt()) {
      consumer.accept(provider);
    }
    else {
      event.getUpdateSession().compute(provider, "update", updateThread, () -> {
        consumer.accept(provider);
        return null;
      });
    }
  }
static <T extends ActionUpdateThreadAware> void updateWithProvider(@NotNull AnActionEvent event,
                                                                     @Nullable T provider,
                                                                     boolean checkDumbAwareness,
                                                                     @NotNull Consumer<T> consumer)