Skip to content

vscode: toolchain switch/update does not restart a running LSP server #250

Description

@0xGeorgii

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

Severity: major

Running Inference: Select Toolchain Version or Inference: Update Toolchain while the language server is running leaves the OLD server serving results from the old toolchain.

performVersionChange calls void ensureLspStarted() (versionChange.ts:37), but ensureLspStarted is an explicit no-op when a client exists (client.ts:91-94). Meanwhile infs default <version> re-points <INFERENCE_HOME>/bin/inference-lsp to the new toolchain (apps/infs/src/toolchain/paths.rs update_symlinks, which handles OPTIONAL_MANAGED_BINARIES). The already-spawned process keeps running the old binary, so diagnostics/hover/goto silently reflect the previous compiler version until the user manually runs Inference: Restart Language Server or reloads the window.

QA_GUIDE.md item 13.16 documents the manual-restart workaround, but nothing in the UI signals that a restart is needed — and the extension otherwise auto-manages the server (auto-start on activation, auto-restart on any inference.lsp.* config change), so users will reasonably assume the switch took effect. The same pattern exists in install.ts:59: reinstalling the managed toolchain while a PATH-resolved server is running.

Suggested fix: in performVersionChange's success path (and install.ts's), call void restartLspClient() instead of ensureLspStarted() — restart already covers the not-running case (doStop no-ops, then doStart), so it is a strict superset of the current behavior.

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