The first factual sentence on every level, including the positive leaf case.
(ir: SemanticIR)
| 738 | |
| 739 | /** The first factual sentence on every level, including the positive leaf case. */ |
| 740 | function subjectLine(ir: SemanticIR): string { |
| 741 | const lines = Math.max(1, ir.symbol.range.end.line - ir.symbol.range.start.line); |
| 742 | const file = displayFile(ir.symbol.uri) ?? ir.symbol.uri; |
| 743 | if (ir.steps.value.length === 0) { |
| 744 | return `${ir.symbol.name} is a ${plainKind(ir.symbol.kind)} spanning ${lines} lines in ${file}. ` |
| 745 | + 'The index resolves no outgoing calls from this symbol.'; |
| 746 | } |
| 747 | const start = ir.symbol.range.start.line + 1; |
| 748 | const end = ir.symbol.range.end.line; |
| 749 | return `${ir.symbol.name} is a ${plainKind(ir.symbol.kind)} spanning ${lines} lines in ${file}, ` |
| 750 | + `from line ${start} through line ${end}.`; |
| 751 | } |
| 752 | |
| 753 | /** Type references whose declaration lies outside the focused symbol. */ |
| 754 | function sharedNames(ir: SemanticIR): string[] { |
no test coverage detected