private static @NotNull List<? extends AttachSourcesProvider.AttachSourcesAction> collectActions(@NotNull List<? extends LibraryOrderEntry> libraries,
                                                                                                   @NotNull PsiFile classFile) {
    List<AttachSourcesProvider.AttachSourcesAction> actions = new ArrayList<>();

    boolean hasNonLightAction = false;
    for (AttachSourcesProvider provider : EXTENSION_POINT_NAME.getExtensionList()) {
      for (AttachSourcesProvider.AttachSourcesAction action : provider.getActions(libraries, classFile)) {
        if (hasNonLightAction) {
          if (action instanceof AttachSourcesProvider.LightAttachSourcesAction) {
            continue; // Don't add LightAttachSourcesAction if non-light action exists.
          }
        }
        else {
          if (!(action instanceof AttachSourcesProvider.LightAttachSourcesAction)) {
            actions.clear(); // All previous actions is LightAttachSourcesAction and should be removed.
            hasNonLightAction = true;
          }
        }
        actions.add(action);
      }
    }

    actions.sort((o1, o2) -> o1.getName().compareToIgnoreCase(o2.getName()));
    return Collections.unmodifiableList(actions);
  }
private static @NotNull List<? extends AttachSourcesProvider.AttachSourcesAction> collectActions(@NotNull List<? extends LibraryOrderEntry> libraries,
                                                                                                   @NotNull PsiFile classFile)