Skip to main content
Zero-config helpers that pick the right language server, its real project root, and tell you plainly when it isn’t installed.

Quick Start

1

Let the agent do it (nothing to configure)

2

Detect language and root yourself (advanced)

3

Probe availability before you use LSP

4

Talk to the client directly with a workspace-aware root


How It Works

Each language maps to a default server, its file extensions, and the root markers that pin a project root — the nearest marker wins.

Which Helper Should I Use?


Public API Surface

These are pure helpers plus one new keyword and one new attribute on LSPClient.

Common Patterns

Guarded startup logging — log what the LSP layer would do for each language:
Monorepo-aware navigation — prove you’re pointing at the right project root:
Fallback to grep with a real reason — surface client.last_error so the model picks a fallback intelligently:

Best Practices

LSPClient.start() no longer raises on a missing binary — it sets last_error and returns False. Reserve try/except for real IO failures.
Without it, the client falls back to os.getcwd(), which is almost never the file’s real project root. workspace_file lets detect_root_uri initialise the server against the nearest root marker.
Error text like install with \…`is for humans. For machine-readable data, callprobe(language)and read the(available, command, install_hint)` tuple.
The edit_tools note appears once per language per run. When you see it, install the server rather than ignore the diagnostic signal for the rest of the session.

LSP Navigation Tools

Go-to-definition, find-references, hover, and symbol search

LSP Tools (reference)

Per-tool parameters and output format

Post-Edit Formatter

Produces the new “diagnostics unavailable” note

Built-in Tool Registry

How Agent(tools=[…]) resolves tool names