* Generate a human-readable line snippet for approval messages.
(entry: InternalFileEntry)
| 549 | * Generate a human-readable line snippet for approval messages. |
| 550 | */ |
| 551 | private getLineSnippet(entry: InternalFileEntry): string { |
| 552 | if (entry.mode === "indentation") { |
| 553 | // Always show indentation mode with the effective anchor line |
| 554 | const effectiveAnchor = entry.anchor_line ?? entry.offset ?? 1 |
| 555 | return `(indentation mode at line ${effectiveAnchor})` |
| 556 | } |
| 557 | |
| 558 | const limit = entry.limit ?? DEFAULT_LINE_LIMIT |
| 559 | const offset1 = entry.offset ?? 1 |
| 560 | |
| 561 | if (offset1 > 1) { |
| 562 | return `(lines ${offset1}-${offset1 + limit - 1})` |
| 563 | } |
| 564 | |
| 565 | // Always show the line limit, even when using the default |
| 566 | return `(up to ${limit} lines)` |
| 567 | } |
| 568 | |
| 569 | /** |
| 570 | * Build and push the final result to the tool output. |