public static @Nullable Pair<PsiFile, Editor> chooseFileForAction(@NotNull PsiFile hostFile,
                                                                    @Nullable Editor hostEditor,
                                                                    @NotNull IntentionAction action) {
    if (hostEditor == null) {
      return Pair.create(hostFile, null);
    }

    return chooseBetweenHostAndInjected(
      hostFile, hostEditor, hostEditor.getCaretModel().getOffset(),
      (psiFile, editor, offset) -> availableFor(psiFile, editor, offset, action)
    );
  }
public static @Nullable Pair<PsiFile, Editor> chooseFileForAction(@NotNull PsiFile hostFile,
                                                                    @Nullable Editor hostEditor,
                                                                    @NotNull IntentionAction action)