Skip to content

Commit

Permalink
Add shell: true option for modern VSCode on Windows (#9242)
Browse files Browse the repository at this point in the history
Summary:
As reported automatically in flow/flow-for-vscode#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 flow/flow-for-vscode#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: #9242

Reviewed By: SamChou19815

Differential Revision: D67295692

fbshipit-source-id: 68e7f68bb6e2593f3579e00a7bbf402b4be0f014
  • Loading branch information
edemaine authored and facebook-github-bot committed Dec 16, 2024
1 parent f32b9ac commit 394ad79
Showing 1 changed file with 1 addition and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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 },
Expand Down

0 comments on commit 394ad79

Please sign in to comment.