Skip to content

Commit

Permalink
[Intellij] Properly replace $Prompt$ macro when launching. Fixes #737
Browse files Browse the repository at this point in the history
  • Loading branch information
fabioz committed Aug 24, 2022
1 parent 8c32785 commit c1e63a7
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,13 @@ public String computeWorkingDir() {
DataContext context = executionEnvironment.getDataContext();
if (str != null && str.contains("$")) {
try {
return MacroManager.getInstance().expandMacrosInString(str, true, context);
MacroManager instance = MacroManager.getInstance();
// It seems that the proper usage is doing 2 runs (the boolean
// passed to expandMacrosInString identifies whether it's the
// first or second pass and the second pass enables running
// macros such as $Prompt$).
str = instance.expandMacrosInString(str, true, context);
str = instance.expandMacrosInString(str, false, context);
} catch (Macro.ExecutionCancelledException e) {
LOG.info(e);
}
Expand Down

0 comments on commit c1e63a7

Please sign in to comment.