private static String expandMacros(@NotNull String path, @NotNull DataContext fallbackDataContext, boolean applyParameterEscaping) {
    if (!Registry.is("allow.macros.for.run.configurations")) {
      return path;
    }

    DataContext context = createContext(fallbackDataContext);
    try {
      Collection<Macro> macros = MacroManager.getInstance().getMacros();
      return MacroManager.expandMacros(path, macros, (macro, occurence) -> {
        String value = StringUtil.notNullize(previewOrExpandMacro(macro, context, occurence));
        return applyParameterEscaping ? ParametersListUtil.escape(value) : value;
      });
    }
    catch (Macro.ExecutionCancelledException ignore) {
      return path; // won't happen :)
    }
  }
private static String expandMacros(@NotNull String path, @NotNull DataContext fallbackDataContext, boolean applyParameterEscaping)