private static void getRegisteredIntentionActions(@NotNull Editor hostEditor,
                                                    @NotNull PsiFile hostFile,
                                                    @NotNull IntentionsInfo intentions,
                                                    int passIdToShowIntentionsFor,
                                                    int offset,
                                                    @Nullable PsiElement psiElement,
                                                    @NotNull List<? extends HighlightInfo.IntentionActionDescriptor> currentFixes) {
    ProgressIndicator indicator = ProgressIndicatorProvider.getGlobalProgressIndicator();
    PsiFile injectedFile = InjectedLanguageUtilBase.findInjectedPsiNoCommit(hostFile, offset);

    Collection<String> languages = getLanguagesForIntentions(hostFile, psiElement, injectedFile);
    List<IntentionAction> availableIntentions = IntentionManager.getInstance().getAvailableIntentions(languages);

    DumbService dumbService = DumbService.getInstance(hostFile.getProject());
    for (IntentionAction action : availableIntentions) {
      ProgressManager.checkCanceled();
      if (!dumbService.isUsableInCurrentContext(action)) {
        continue;
      }

      if (indicator != null) {
        indicator.setText(action.getFamilyName());
      }
      Pair<PsiFile, Editor> place =
        ShowIntentionActionsHandler.chooseBetweenHostAndInjected(hostFile, hostEditor, offset, injectedFile,
                                                                 (psiFile, editor, o) -> ShowIntentionActionsHandler.availableFor(psiFile, editor, o, action));

      if (place != null) {
        List<IntentionAction> enableDisableIntentionAction = new ArrayList<>();
        enableDisableIntentionAction.add(new EnableDisableIntentionAction(action));
        enableDisableIntentionAction.add(new EditIntentionSettingsAction(action));
        if (IntentionShortcutManager.getInstance().hasShortcut(action)) {
          enableDisableIntentionAction.add(new EditShortcutToIntentionAction(action));
          enableDisableIntentionAction.add(new RemoveIntentionActionShortcut(action));
        }
        else {
          enableDisableIntentionAction.add(new AssignShortcutToIntentionAction(action));
        }
        HighlightInfo.IntentionActionDescriptor descriptor =
          new HighlightInfo.IntentionActionDescriptor(action, enableDisableIntentionAction, null, null, null, null, null);
        if (!currentFixes.contains(descriptor)) {
          intentions.intentionsToShow.add(descriptor);
        }
      }
    }

    if (indicator != null) {
      indicator.setText(CodeInsightBundle.message("progress.text.searching.for.additional.intention.actions.quick.fixes"));
    }
    for (IntentionMenuContributor extension : IntentionMenuContributor.EP_NAME.getExtensionList()) {
      ProgressManager.checkCanceled();
      try {
        if (dumbService.isUsableInCurrentContext(extension)) {
          extension.collectActions(hostEditor, hostFile, intentions, passIdToShowIntentionsFor, offset);
        }
      }
      catch (IntentionPreviewUnsupportedOperationException e) {
        //can collect action on a mock memory editor and produce exceptions - ignore
      }
    }
  }
private static void getRegisteredIntentionActions(@NotNull Editor hostEditor,
                                                    @NotNull PsiFile hostFile,
                                                    @NotNull IntentionsInfo intentions,
                                                    int passIdToShowIntentionsFor,
                                                    int offset,
                                                    @Nullable PsiElement psiElement,
                                                    @NotNull List<? extends HighlightInfo.IntentionActionDescriptor> currentFixes)