Skip to content

bug: tsgo server requests are treated as unknown responses #100

Description

@dergachoff

Problem

mcpls times out against tsgo --lsp --stdio for requests such as textDocument/documentSymbol.

During initialization, tsgo sends a valid server-to-client JSON-RPC request:

{"jsonrpc":"2.0","id":"ts1","method":"client/registerCapability","params":{"registrations":[{"id":"typescript-config-watch-id","method":"workspace/didChangeConfiguration","registerOptions":{"section":["js/ts","typescript","javascript","editor"]}}]}}

mcpls logs it as:

Received response for unknown request ID: String("ts1")

Root Cause

Inbound JSON-RPC messages with an id are always classified as responses. LSP servers can also send requests to the client; those messages have both id and method.

Fix

Classify inbound messages by JSON-RPC shape:

  • id + method -> server request
  • id + result/error -> response
  • method without id -> notification

Then reply to common LSP client requests, including client/registerCapability and workspace/configuration.

I have a local patch with focused unit tests and a tsgo behavior probe.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions