LSP Phase 7: CLI + config plumbing through build_channels - #31
Merged
Conversation
This was referenced May 20, 2026
yogthos
changed the base branch from
feature/lsp-phase-6-edit-integration
to
main
May 20, 2026 01:46
src/config/mod.rs - LspConfig: untagged enum, accepts `true`/`false` OR a map of per-server overrides. - LspServerConfig: all-optional fields (command, extensions, env, initialization, disabled). Missing fields fall back to built-in. - Config gains an optional `lsp` field; default-None (which the CLI resolver treats as enabled-with-built-ins). - 4 config-parse tests: bool form, per-server map form, absent-is-None, mixed command/disabled entries. src/cli.rs - `--no-lsp` flag. - `resolve_lsp_enabled(cli, cfg)` resolver: no-tools or no-lsp turns it off; otherwise the config bool (default true) decides. src/lsp/spawn.rs - ProcessSpawner::default_commands(): the 4 built-in commands for v1 servers (rust-analyzer, typescript-language-server --stdio, pyright-langserver --stdio, clojure-lsp). User config overrides are merged in main::compile_lsp_commands. src/main.rs - build_channels grows a 10th return slot: Option<Arc<LspManager>>. Constructed when lsp_enabled, via ProcessSpawner with merged defaults + user overrides. - compile_lsp_commands: starts from defaults, applies per-server overrides (disabled removes, command replaces, env/init merge). - Threaded through all 3 `build_agent` call sites + run_interactive. src/provider.rs + src/agent/builder.rs - New `lsp_manager: Option<Arc<LspManager>>` arg on build_agent / build_agent_inner. Threaded down to the WriteTool / EditTool / ReadTool constructors (which Phase 6 prepared the field for) AND to the LspTool registration (Phase 5's tool now actually gets attached to the agent when lsp_manager is present). src/ui/mod.rs + src/ui/slash.rs + src/extras/acp/mod.rs - run_interactive accepts and forwards lsp_manager. - Plan-switch rebuild passes the live lsp_manager.clone() (so the rebuilt agent still has LSP tools — same pattern as the bg-store fix from Phase 5). - 7 slash.rs sub-rebuild sites + 2 ui/mod.rs prompt-switch sites pass `None` for lsp_manager (intentional — these rebuild for /model, /context-reset etc., which don't need to re-attach LSP). - ACP path passes `None`. src/agent/tools/lsp.rs - Drops the Phase-5 `#![allow(dead_code)]` now that builder.rs wires it. Phase 6: 116, Phase 7: +4 config tests -> 120 LSP tests. Suite: 422 -> 426.
yogthos
force-pushed
the
feature/lsp-phase-7-plumbing
branch
from
May 20, 2026 01:54
bba4943 to
9f746ab
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Phase 7 of 9. Stacked on #30 (Phase 6). The plumbing pass that connects everything end-to-end — by the end of this PR the agent actually gets LSP-aware tools attached to it.
Config schema (`src/config/mod.rs`)
```json
{
"lsp": true // built-ins on
"lsp": false // off entirely
"lsp": { // built-ins on, with per-server overrides
"rust": { "command": ["my-rust-analyzer", "--my-arg"], "env": {"RUST_LOG": "info"} },
"typescript": { "disabled": true }
}
}
```
`LspServerConfig`: `command`, `extensions`, `env`, `initialization`, `disabled` — all optional, missing fields fall back to the built-in defaults.
4 config-parse tests: bool form, per-server map form, absent-is-None (default-on), mixed command/disabled entries.
CLI (`src/cli.rs`)
Default server commands (`src/lsp/spawn.rs::default_commands`)
Plumbing
`main::build_channels` grows a 10th return slot: `Option<Arc>`. `compile_lsp_commands` merges defaults + user overrides into the spawner command map.
Threaded through:
What this PR doesn't do
Test plan
Next: Phase 8 (feature flag) and Phase 9 (docs + manual end-to-end against real rust-analyzer).