| 291 | }) |
| 292 | |
| 293 | function cmd(shell: string, command: string, cwd: string, env: NodeJS.ProcessEnv) { |
| 294 | if (process.platform === "win32" && Shell.ps(shell)) { |
| 295 | return ChildProcess.make(shell, ["-NoLogo", "-NoProfile", "-NonInteractive", "-Command", command], { |
| 296 | cwd, |
| 297 | env, |
| 298 | stdin: "ignore", |
| 299 | detached: false, |
| 300 | }) |
| 301 | } |
| 302 | |
| 303 | return ChildProcess.make(command, [], { |
| 304 | shell, |
| 305 | cwd, |
| 306 | env, |
| 307 | stdin: "ignore", |
| 308 | detached: process.platform !== "win32", |
| 309 | }) |
| 310 | } |
| 311 | const parser = lazy(async () => { |
| 312 | const { Parser } = await import("web-tree-sitter") |
| 313 | const { default: treeWasm } = await import("web-tree-sitter/tree-sitter.wasm" as string, { |