From 4ec9bb566ce3c73ba850ec157d65fc1ace2dab6f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Peter=20Str=C3=B6mberg?= Date: Sat, 1 May 2021 07:54:07 -0800 Subject: [PATCH] Write deps.edn win jack-in command line to a file Then execute that file Fixes #1162 --- src/nrepl/jack-in.ts | 7 +++++++ src/nrepl/project-types.ts | 6 +++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/src/nrepl/jack-in.ts b/src/nrepl/jack-in.ts index 3ccba0583..b6327446c 100644 --- a/src/nrepl/jack-in.ts +++ b/src/nrepl/jack-in.ts @@ -162,6 +162,13 @@ async function getJackInTerminalOptions(projectConnectSequence: ReplConnectSeque } executable = cmd[0]; args = [...cmd.slice(1), ...args]; + if (projectTypes.isWin && projectType.resolveBundledPathWin) { + const cmdFile = path.join('.calva', 'start.cmd'); + const cmdFileUri = vscode.Uri.file(path.join(state.getProjectRootLocal(), '.calva', 'start.cmd')) + utilities.writeTextToFile(cmdFileUri, createCommandLine(executable, args)) + executable = cmdFile; + args = []; + } const terminalOptions: JackInTerminalOptions = { name: `Calva Jack-in: ${projectConnectSequence.name}`, diff --git a/src/nrepl/project-types.ts b/src/nrepl/project-types.ts index 9e98c92e9..abbfc7455 100644 --- a/src/nrepl/project-types.ts +++ b/src/nrepl/project-types.ts @@ -251,7 +251,7 @@ const cljsMiddleware: { [id: string]: string[] } = { const serverPrinterDependencies = pprint.getServerSidePrinterDependencies(); function depsCljWindowsPath() { - return `"${path.join('.', '.calva', 'deps.clj.jar')}"`; + return `${path.join('.', '.calva', 'deps.clj.jar')}`; } const projectTypes: { [id: string]: ProjectType } = { @@ -368,7 +368,7 @@ const projectTypes: { [id: string]: ProjectType } = { resolveBundledPathWin: depsCljWindowsPath, resolveBundledPathUnix: () => `'${path.join(state.extensionContext.extensionPath, 'deps.clj.jar')}'`, processShellUnix: true, - processShellWin: true, + processShellWin: false, useWhenExists: undefined, nReplPortFile: [".nrepl-port"], commandLine: async (connectSequence: ReplConnectSequence, cljsType: CljsTypes) => { @@ -458,7 +458,7 @@ async function cljCommandLine(connectSequence: ReplConnectSequence, cljsType: Cl if (selectedAliasesHasMain) { args.push(aliasesOption); } else { - args.push(aliasesOption, "-m", "nrepl.cmdline", "--middleware", `"[${useMiddleware.join(' ')}]"`); + args.push(aliasesOption, "-m", "nrepl.cmdline", "--middleware", `${q}[${useMiddleware.join(' ')}]${q}`); } return args;