From 394ad79dff198b2a7e725aab6b26d8b0ead10eff Mon Sep 17 00:00:00 2001 From: Erik Demaine Date: Mon, 16 Dec 2024 13:35:18 -0800 Subject: [PATCH] Add `shell: true` option for modern VSCode on Windows (#9242) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Summary: As reported automatically in https://github.com/flow/flow-for-vscode/issues/458, this plugin needs to engage the shell to launch the LSP on modern VSCode on Windows, because the script is generally installed as `flow-bin/cli.cmd` and only the shell can execute those. (port of https://github.com/flow/flow-for-vscode/pull/464) Personally I still have issues using this plugin in my setup, because of the use of [`bin-version`](https://www.npmjs.com/package/bin-version) which calls [`execa`](https://github.com/sindresorhus/execa) which calls [`cross-spawn`](https://github.com/moxystudio/node-cross-spawn), which doesn't seem to support Flow via `yarn` on Windows (which creates `.js` files but no `.cmd`/.bat` file) — not sure exactly why. In the future, I'd suggest moving away from this rather heavy chain of dependencies. Let me know if you'd like a PR to that effect. Pull Request resolved: https://github.com/facebook/flow/pull/9242 Reviewed By: SamChou19815 Differential Revision: D67295692 fbshipit-source-id: 68e7f68bb6e2593f3579e00a7bbf402b4be0f014 --- .../flow-for-vscode/src/FlowLanguageClient/FlowLanguageClient.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/flow-for-vscode/src/FlowLanguageClient/FlowLanguageClient.ts b/packages/flow-for-vscode/src/FlowLanguageClient/FlowLanguageClient.ts index db0a1e746a2..462ca0ab820 100644 --- a/packages/flow-for-vscode/src/FlowLanguageClient/FlowLanguageClient.ts +++ b/packages/flow-for-vscode/src/FlowLanguageClient/FlowLanguageClient.ts @@ -187,6 +187,7 @@ export default class FlowLanguageClient { // auto stop flow process config.stopFlowOnExit ? '--autostop' : null, ].filter((v) => v != null), + options: { shell: true }, // see: clientOptions.workspaceFolder below // options: { cwd: flowconfigDir },