diff --git a/CHANGELOG.md b/CHANGELOG.md index 66984dcc3..fa0d50e06 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ Changes to Calva. ## [Unreleased] +- [Continue to support -Aalias for jack-in](https://github.com/BetterThanTomorrow/calva/issues/1474) - [Add custom commands from libraries](https://github.com/BetterThanTomorrow/calva/pull/1442) - Workaround: [VS Code highlights characters in the output/REPL window prompt](https://github.com/BetterThanTomorrow/calva/pull/1475) - [Exclude REPL output window from LSP analysis](https://github.com/BetterThanTomorrow/calva/issues/1250) diff --git a/package.json b/package.json index f6b9256cc..1d4521c6d 100644 --- a/package.json +++ b/package.json @@ -331,6 +331,11 @@ "calva.customCljsRepl": { "deprecationMessage": "This settings is deprecated. Use `cljsType` in a `calva.replConnectSequences` item instead." }, + "calva.jackIn.useDeprecatedAliasFlag": { + "type": "boolean", + "default": false, + "markdownDescription": "Use the `-A` flag instead of `-M` for Clojure CLI versions < `1.10.697`." + }, "calva.jackInEnv": { "type": "object", "default": {}, diff --git a/src/config.ts b/src/config.ts index 4c8f227d8..78110d44b 100644 --- a/src/config.ts +++ b/src/config.ts @@ -99,7 +99,10 @@ function getConfig() { referencesCodeLensEnabled: configOptions.get('referencesCodeLens.enabled') as boolean, hideReplUi: configOptions.get('hideReplUi') as boolean, strictPreventUnmatchedClosingBracket: pareditOptions.get('strictPreventUnmatchedClosingBracket'), - showCalvaSaysOnStart: configOptions.get("showCalvaSaysOnStart") as boolean + showCalvaSaysOnStart: configOptions.get("showCalvaSaysOnStart") as boolean, + jackIn: { + useDeprecatedAliasFlag: configOptions.get("jackIn.useDeprecatedAliasFlag") as boolean, + } }; } diff --git a/src/nrepl/project-types.ts b/src/nrepl/project-types.ts index 76a5bf1a8..de74cc2e7 100644 --- a/src/nrepl/project-types.ts +++ b/src/nrepl/project-types.ts @@ -473,7 +473,9 @@ async function cljCommandLine(connectSequence: ReplConnectSequence, cljsType: Cl ...serverPrinterDependencies }; const useMiddleware = [...middleware, ...(cljsType ? cljsMiddleware[cljsType] : [])]; - const aliasesOption = aliases.length > 0 ? `-M${aliases.join("")}` : '-M'; + + const aliasesFlag = getConfig().jackIn.useDeprecatedAliasFlag ? ['-A', ''] : ['-M', '-M']; + const aliasesOption = aliases.length > 0 ? `${aliasesFlag[0]}${aliases.join("")}` : aliasesFlag[1]; const q = isWin ? '"' : "'"; const dQ = isWin ? '""' : '"'; for (let dep in dependencies)