Skip to content

lsp_tools_show_incorrect_status_on_Windows #11400

@tancem-sys

Description

@tancem-sys

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 running opencode 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

  1. Navigate to a project directory containing .ts files (e.g., backend/)
  2. Run: opencode debug lsp diagnostics "src/main.ts" --print-logs --log-level DEBUG
  3. Observe logs showing successful LSP initialization
  4. Run: lsp_servers → shows typescript [not installed]
  5. 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

Metadata

Metadata

Assignees

Labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions