You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
src/lsp/diagnostic.rs (new)
- pretty(diagnostic): one-line 'SEVERITY [line:col] msg' rendering with
LSP 0-based → display 1-based coordinate conversion.
- report(file, issues): wraps in <diagnostics file="..."> block.
ERROR severity only (warnings/hints are noise). MAX_PER_FILE=20 with
'... and N more' overflow footer.
- build_report_block(current, all): the full agent-facing block that
write/edit tools append. Two sections (each optional): current file
errors, then up to MAX_PROJECT_DIAGNOSTICS_FILES=5 other-file errors
(e.g. downstream callers that now fail type-checking).
- 15 tests covering: severity labels, 1-based coordinate display,
missing-severity defaults to ERROR (regression — pretty must never
panic or hide a diagnostic), error filtering (regression — warnings
must NOT appear), wrap tags, cap at MAX_PER_FILE with overflow
(regression — generated files with hundreds of errors must not blow
context), other-files cap (regression — single edit shouldn't dump
entire project state), warning-only files don't appear, caller path
preserved in display (regression — not canonical form).
src/agent/tools/write.rs
- New optional Option<Arc<LspManager>> field. With manager set, after
the write: touch_file(AwaitPush) + build_report_block + append to
output. DIAGNOSTIC_WAIT = 10s matches opencode.
- Shared append_lsp_block helper used by both write and edit.
- 2 tests: no-manager path preserves pre-LSP output exactly
(regression); manager-with-no-diagnostics appends nothing.
src/agent/tools/edit.rs
- Same Option<Arc<LspManager>> field + integration. Diagnostic block
appended after the existing diff block.
src/agent/tools/read.rs
- New optional Option<Arc<LspManager>> field. Read warms the LSP server
with a fire-and-forget tokio::spawn(touch_file(Notify)). The read's
primary output is unchanged — no diagnostic block (that's the edit
tool's job).
src/agent/builder.rs
- All three tool constructors now pass None for lsp_manager. Phase 7's
CLI/config plumbing will populate it.
Code review fixes applied before push:
- Display caller path (not canonical form) in current-file section so
macOS /tmp / /private/tmp asymmetry doesn't confuse the agent.
Phase 5: 100, Phase 6: +16 -> 116 LSP tests. Suite: 405 -> 421.
0 commit comments