From 8b68711acfaab6a7c247398c5feb90148bd8a5b3 Mon Sep 17 00:00:00 2001 From: Anouar Touati Date: Mon, 30 Dec 2024 11:06:23 -0500 Subject: [PATCH] Fixes: Can't find praser binary on windows when path has spaces --- src/support/parser.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/support/parser.ts b/src/support/parser.ts index b9f113c..03d0d08 100644 --- a/src/support/parser.ts +++ b/src/support/parser.ts @@ -31,7 +31,6 @@ export const setParserBinaryPath = (context: vscode.ExtensionContext) => { downloadBinary(context).then((path) => { if (path) { parserBinaryPath = process.env.PHP_PARSER_BINARY_PATH || path; - parserBinaryPath = path.replace(" ", "\\ "); } }); }; @@ -170,7 +169,7 @@ const runCommand = (command: string): Promise => { } const extraArgs = os.platform() === "win32" ? "--from-file" : ""; - const toRun = `${parserBinaryPath} ${command} ${extraArgs}`; + const toRun = `"${parserBinaryPath}" ${command} ${extraArgs}`; // console.log("running command", toRun);