Skip to content

Commit 9aa2a80

Browse files
authored
fix(operation): report actual file total_lines instead of content slice line count (#2771)
1 parent 86d9778 commit 9aa2a80

3 files changed

Lines changed: 3 additions & 3 deletions

File tree

crates/forge_app/src/operation.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,7 @@ impl ToolOperation {
271271
"display_lines",
272272
format!("{}-{}", output.info.start_line, output.info.end_line),
273273
)
274-
.attr("total_lines", content.lines().count())
274+
.attr("total_lines", output.info.total_lines)
275275
.cdata(content);
276276

277277
// Track read operations

crates/forge_app/src/snapshots/forge_app__operation__tests__fs_read_with_explicit_range.snap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ expression: to_value(actual)
55
<file
66
path="/home/user/test.txt"
77
display_lines="2-3"
8-
total_lines="3"
8+
total_lines="5"
99
><![CDATA[2:Line 1
1010
3:Line 2
1111
4:Line 3]]>

crates/forge_app/src/snapshots/forge_app__operation__tests__fs_read_with_truncation_path.snap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,6 @@ expression: to_value(actual)
55
<file
66
path="/home/user/large_file.txt"
77
display_lines="1-100"
8-
total_lines="1"
8+
total_lines="200"
99
><![CDATA[1:Truncated content]]>
1010
</file>

0 commit comments

Comments
 (0)