Skip to content

vscode: LSP client lifecycle robustness — config-change race, hung-start wedges the queue, trace setting, untitled buffers #251

Description

@0xGeorgii

Follow-up from the comprehensive review of PR #239 (LSP server). Line numbers reference the PR branch at review time.

Severity: minor (1-2), nit (3-4) — VS Code LSP client lifecycle robustness (editors/vscode/src/lsp/client.ts).

  1. Config-change decision samples running outside the serialized queue (client.ts:105-121): handleLspConfigChange computes the action at event time using isLspRunning(), which only reflects completed queue operations (client is assigned only after candidate.start() resolves). Scenario: a path change enqueues restart; while doStart is awaiting start(), the user disables inference.lsp.enabled — the disable event sees running == false, decides no stop is needed, and the server ends up running against enabled: false. Decide the action inside the queued operation (or re-check state when the queued op runs).
  2. A spawned-but-unresponsive server wedges the queue forever (client.ts:173): doStart awaits candidate.start() with no timeout; vscode-languageclient v9's start() awaits the initialize response with no timeout either. A binary that spawns, holds stdin open, and never answers initialize permanently blocks every subsequent lifecycle operation (restart command included) with no user-visible signal. Add a timeout + error surface.
  3. inference-lsp.trace.server is not contributed in package.json (package.json:151), so the standard vscode-languageclient protocol-trace knob is undiscoverable and flags as an unknown setting.
  4. documentSelector is [{ scheme: 'file', language: 'inference' }] (client.ts:162): untitled .inf buffers get no language features, which contradicts the bundled walkthrough's "Create New File" step. Consider adding scheme: 'untitled' (the server's URI layer currently ignores non-file URIs gracefully — see the e2e "non_file_uri" tests — so this also needs the server to accept untitled docs or the selector decision documented).

Related: the promise-queue race-freedom invariant has zero tests — tracked in the test-coverage follow-up issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingvscodeVSCode extension

    Type

    No type

    Fields

    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