-
Notifications
You must be signed in to change notification settings - Fork 9.1k
Open
Labels
Description
Description
lsp_servers and lsp_diagnostics tools incorrectly report that TypeScript LSP is not installed on Windows, even though LSP server is successfully running in the background.
Environment Information
- OS: Windows 11
- Node.js: v22.13.0 (via nvm4w)
- npm global path:
C:\nvm4w\nodejs - OpenCode version: 1.1.42 (latest)
- Project: NestJS backend with TypeScript 5.9.3
Problem
Evidence of LSP Working (from logs)
When runningopencode debug lsp diagnostics "src/main.ts" --print-logs --log-level DEBUG, logs show:
INFO ... service=lsp.server tsserver=F:\Code\Projects\xiaofupo\WalletPro\backend\node_modules\typescript\lib\tsserver.js typescript server
INFO ... service=lsp.serverID=typescript spawned lsp server
INFO ... service=lsp.client serverID=typescript starting client
INFO ... service=lsp.client serverID=typescript initialized
INFO ... service=bus type=lsp.client.diagnostics unsubscribing{}
This proves that: - ✅ LSP server successfully spawns
- ✅ LSP client successfully initializes
- ✅ Diagnostics are returned (empty object
{}= no errors) - ✅ LSP server properly shuts down
Tools Report Incorrect Status
Despite the above evidence:
lsp_servers output:
typescript not installed - .ts, .tsx, .js, .jsx, .mjs, .cjs, .mts, .cts
lsp_diagnostics output:
Error: LSP server 'typescript' is configured but NOT INSTALLED.
Command not found: typescript-language-server
To install:
npm install -g typescript-language-server typescript
This is clearly incorrect as LSP is running and functioning.
Steps to Reproduce
- Navigate to a project directory containing
.tsfiles (e.g.,backend/) - Run:
opencode debug lsp diagnostics "src/main.ts" --print-logs --log-level DEBUG - Observe logs showing successful LSP initialization
- Run:
lsp_servers→ showstypescript [not installed] - Run:
lsp_diagnostics <file>→ reports error about command not found
Expected Behavior
lsp_servers should show typescript [installed] when LSP server is running.
lsp_diagnostics should execute diagnostics without path errors.
Additional Context
- The project has
typescriptdependency inpackage.json - The project has
typescript-language-serverinnode_modules(v5.1.3) - LSP works correctly when invoked via
opencode debug lsp diagnostics - Similar issues reported: jdtls lsp server does not work properly in a window environment. #7270 (jdtls lsp server does not work properly in a window environment)