Skip to content

Auto-install: toolchain-gated LSP servers (runtimeInstall + canonical bin discovery) #241

Description

@apmantza

Problem

ensureTool() can only auto-install servers present in the installer TOOLS registry, which covers npm/pip/gem + single-binary github/maven/archive. A family of language servers is not in the registry because they require a full language toolchain or a non-binary install, so ensureTool returns UNAVAILABLE and they only run if the user has the binary on PATH:

  • goplsgo install golang.org/x/tools/gopls@latest (needs Go; lands in GOPATH/bin)
  • csharp-ls / fsautocompletedotnet tool install (needs .NET; lands in ~/.dotnet/tools)
  • sourcekit-lsp — ships with the Swift toolchain (not separately installable)
  • haskell-language-server — ghcup-managed
  • ocamllsp — opam-managed
  • nixd — nix-managed

These are deliberately out of scope today ("bring your own server"). This issue tracks closing that gap properly.

Proposal

  1. runtimeInstall step gated on toolchain presence. When the language runtime is on PATH (e.g. go, dotnet, opam), run the canonical install command; otherwise report unavailable (never auto-install the toolchain itself). The resolveAndLaunch spec already has a runtimeInstall hook — extend coverage to these servers.
  2. Canonical-bin discovery. Teach installer discovery to look in toolchain-managed bin dirs even when not on PATH: GOPATH/bin (or go env GOPATH), ~/.dotnet/tools, ~/.cargo/bin, opam/ghcup switch bins. This is the real fix for "the toolchain is installed but its server bin isn't on PATH" — discovery, not user PATH edits.

Out of scope / related

  • Whole-tree GitHub-release servers that need their full distribution (clangd's builtin headers, lua-language-server's lib/, kotlin-language-server/elixir-ls JVM/BEAM) need a platform-matched archive strategy (current ArchiveSpec has a single hardcoded URL). Track separately if desired.
  • clojure-lsp + gleam (single native binaries) are now registered (f263cf3).

Context

Surfaced characterizing the LSP capability matrix (#240) — the nightly tool-smoke only ⚠-skips these servers, so they're never exercised.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:installerTool auto-install / binary fetcharea:lspLSP servers & integrationenhancementImprove/harden/refactor/perf an existing capability (not net-new)

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions