( prepared: PreparedTextWithSegments, normalizedText: string, contentWidth: number, lineHeight: number, measuredFont: string, )
| 493 | } |
| 494 | |
| 495 | function getPublicLines( |
| 496 | prepared: PreparedTextWithSegments, |
| 497 | normalizedText: string, |
| 498 | contentWidth: number, |
| 499 | lineHeight: number, |
| 500 | measuredFont: string, |
| 501 | ): ProbeLine[] { |
| 502 | return layoutWithLines(prepared, contentWidth, lineHeight).lines.map(line => { |
| 503 | const start = line.start.segmentIndex === 0 && line.start.graphemeIndex === 0 |
| 504 | ? 0 |
| 505 | : computeOffsetFromCursor(prepared, line.start) |
| 506 | const end = computeOffsetFromCursor(prepared, line.end) |
| 507 | const content = getLineContent(line.text, end) |
| 508 | const contentEnd = start + content.text.length |
| 509 | const logicalText = normalizedText.slice(start, contentEnd) |
| 510 | |
| 511 | return { |
| 512 | text: logicalText, |
| 513 | renderedText: line.text, |
| 514 | contentText: content.text, |
| 515 | start, |
| 516 | end, |
| 517 | contentEnd, |
| 518 | fullWidth: measureCanvasTextWidth(diagnosticCtx, content.text, measuredFont), |
| 519 | domWidth: measureDomTextWidth(document, content.text, measuredFont, direction), |
| 520 | sumWidth: measurePreparedSlice(prepared, start, contentEnd, measuredFont), |
| 521 | } |
| 522 | }) |
| 523 | } |
| 524 | |
| 525 | function summarizeLines(lines: ProbeLine[]): ProbeLineSummary[] { |
| 526 | return lines.map((line, index) => ({ |
no test coverage detected
searching dependent graphs…