opencode
opencode copied to clipboard
fix(lsp): add shell option for Dart LSP on Windows
Summary
Fixes the Dart LSP failing on Windows with "Command not found: dart" error by adding shell: true to the spawn options when running on Windows.
Problem
On Windows, the Dart LSP server fails to start even when dart is correctly installed and in PATH. The error occurs because:
-
Bun.which("dart")finds a valid path (e.g.,C:\Users\...\bin\dart.exe) - However,
spawn()withoutshell: truecan fail on Windows for certain executable configurations
Solution
Add shell: process.platform === "win32" to the spawn options, following the same pattern used elsewhere in the codebase (e.g., npm.cmd handling in ESLint LSP).
Testing
- Verified on Windows 10/11 with Dart SDK 3.5.4
- Confirmed
dart language-server --lspworks via shell - Minimal change, no impact on non-Windows platforms
Fixes #6861
cc @thdxr @adamdotdevin