(i: number, sectionsOnly: boolean)
| 380 | ): void { |
| 381 | /** 1-based last line of the region started at children[i]. */ |
| 382 | const regionEnd = (i: number, sectionsOnly: boolean): number => { |
| 383 | for (let j = i + 1; j < children.length; j++) { |
| 384 | const c = children[j]!; |
| 385 | if (c.type === 'section_header' || (!sectionsOnly && c.type === 'paragraph_header')) { |
| 386 | // Header starts at 0-based row R → the region ends on 1-based line R. |
| 387 | return Math.max(c.startPosition.row, line(children[i]!)); |
| 388 | } |
| 389 | } |
| 390 | return divisionEndLine; |
| 391 | }; |
| 392 | |
| 393 | let currentFnId = currentScope(ctx); |
| 394 | let sectionPushed = false; |
no test coverage detected