Measure how many terminal rows one planned row occupies in a concrete section row plan.
(
row: PlannedReviewRow,
{
layout,
lineNumberDigits,
showHunkHeaders,
reserveAddNoteColumn,
showLineNumbers,
theme,
width,
wrapLines,
}: DiffSectionRowHeightOptions,
)
| 173 | |
| 174 | /** Measure how many terminal rows one planned row occupies in a concrete section row plan. */ |
| 175 | function measurePlannedDiffSectionRowHeight( |
| 176 | row: PlannedReviewRow, |
| 177 | { |
| 178 | layout, |
| 179 | lineNumberDigits, |
| 180 | showHunkHeaders, |
| 181 | reserveAddNoteColumn, |
| 182 | showLineNumbers, |
| 183 | theme, |
| 184 | width, |
| 185 | wrapLines, |
| 186 | }: DiffSectionRowHeightOptions, |
| 187 | ) { |
| 188 | if (row.kind === "inline-note") { |
| 189 | return measureAgentInlineNoteHeight({ |
| 190 | annotation: row.annotation, |
| 191 | anchorSide: row.anchorSide, |
| 192 | layout, |
| 193 | width, |
| 194 | }); |
| 195 | } |
| 196 | |
| 197 | return measureRenderedRowHeight( |
| 198 | row.row, |
| 199 | width, |
| 200 | lineNumberDigits, |
| 201 | showLineNumbers, |
| 202 | showHunkHeaders, |
| 203 | wrapLines, |
| 204 | theme, |
| 205 | reserveAddNoteColumn, |
| 206 | ); |
| 207 | } |
| 208 | |
| 209 | /** Measure one file section from the same render plan used by PierreDiffView. */ |
| 210 | export function measureDiffSectionGeometry( |
no test coverage detected