Skip to content

LSP workspaceDiagnostics and diagnostics return empty for typescript-language-server #3029

@vadimLuzyanin

Description

@vadimLuzyanin

What happened?

Both diagnostics(filePath) (single file) and workspaceDiagnostics() (entire workspace) return empty results when using typescript-language-server (and other push-diagnostic-only servers like vtsls).

What did you expect to happen?

After opening a file, both diagnostics() and workspaceDiagnostics() should return diagnostics from the LSP server, just like VS Code does.

Client information

Client Information

Qwen Code 0.14.2 (f296eb1)
Runtime Node.js v20.9.0 / npm 10.1.0
IDE Client VS Code
OS linux x64 (6.6.87.2-microsoft-standard-WSL2)

Auth Qwen OAuth
Model coder-model
Fast Model coder-model
Session ID f4f49fa9-abf0-4c9f-8d70-ebc647d0b880
Sandbox no sandbox
Proxy no proxy
Memory Usage 272.7 MB

Login information

No response

Anything else we need to know?

Root cause: tsserver only supports the push model (textDocument/publishDiagnostics notifications, LSP 3.16) and does not support the pull model (workspace/diagnostic, textDocument/diagnostic requests, LSP 3.17):

  1. workspaceDiagnostics() calls workspace/diagnostic — tsserver throws "not supported", catch block returns nothing.
  2. diagnostics(uri) calls textDocument/diagnostic — same failure, same dead catch.
  3. The publishDiagnostics capability is not declared in the initialize request, so tsserver never sends diagnostic notifications in the first place.
  4. Even if diagnostics were somehow cached, there's no fallback path to read from that cache when the pull model fails.

Metadata

Metadata

Assignees

Labels

status/needs-triageIssue needs to be triaged and labeledtype/bugSomething isn't working as expected

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