mirror of
https://github.com/zed-industries/zed.git
synced 2026-05-23 21:05:08 +00:00
Format `read_file` tool output in `cat -n` style: each line is prefixed with its line number right-aligned in a 6-character field, followed by a single tab, followed by the line's original content (newlines preserved, including CRLF). Numbering reflects the actual file lines, so a ranged read starting at line 42 emits `42` for its first line, not `1`. For large files, content returned by `get_buffer_content_or_outline` is **not** prefixed: - The symbol outline path already conveys structure via its `[L100-150]` annotations. - The truncated first-1KB fallback (used when a file exceeds `AUTO_OUTLINE_SIZE` and has no parseable outline) is wrapped in a synthetic `# First 1KB of …` header, so its lines don't correspond to real file line numbers. Both cases are reported via `BufferContent::is_synthetic` (renamed from `is_outline`). Also updates the `edit_file` tool's input doc to describe the prefix format and tell the model to strip it before constructing `old_text` / `new_text`, preserving the original indentation that appears after the tab. Updates how we render `read_file` tool call outputs in the UI (screenshots included in comments below). Also fixes an existing bug where `read_file` tool call outputs would not re-render their content code block when an older thread was restored (the tool's `replay` hook was missing). Closes AI-226 Release Notes: - Improved how `read_file` tool output renders in the agent panel, with a line-number gutter, and fixed it not re-rendering on restored threads --------- Co-authored-by: zed-zippy[bot] <234243425+zed-zippy[bot]@users.noreply.github.com> |
||
|---|---|---|
| .. | ||
| src | ||
| Cargo.toml | ||
| LICENSE-GPL | ||