private static boolean isEnabled(@Nullable Project project) {
    if (project == null) return false;
    if (ApplicationManager.getApplication().isInternal()) return true;
    for (Module module : ModuleManager.getInstance(project).getModules()) {
      if ("PLUGIN_MODULE".equals(ModuleType.get(module).getId())) {
        return true;
      }
    }
    return PsiViewerActionEnabler.isActionEnabled(project);
  }
private static boolean isEnabled(@Nullable Project project)