opencode icon indicating copy to clipboard operation
opencode copied to clipboard

fix(lsp): add shell option for Dart LSP on Windows

Open ravergurl opened this issue 1 week ago • 0 comments

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:

  1. Bun.which("dart") finds a valid path (e.g., C:\Users\...\bin\dart.exe)
  2. However, spawn() without shell: true can 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 --lsp works via shell
  • Minimal change, no impact on non-Windows platforms

Fixes #6861

cc @thdxr @adamdotdevin

ravergurl avatar Jan 04 '26 20:01 ravergurl