(content: string, lineOffset: number)
| 54 | } |
| 55 | |
| 56 | function buildPreview(content: string, lineOffset: number): string { |
| 57 | const lines = content.split('\n'); |
| 58 | const start = Math.max(0, lineOffset - 1); |
| 59 | const end = Math.min(lines.length, lineOffset + 2); |
| 60 | const previewLines = lines.slice(start, end); |
| 61 | return previewLines.join('\n').trim(); |
| 62 | } |
| 63 | |
| 64 | function buildPreviewFromFileLines(lines: string[], line: number): string { |
| 65 | const start = Math.max(0, line - 2); |
no outgoing calls
no test coverage detected