(entryPoints: readonly SymbolSearchHit[], rank: number)
| 405 | } |
| 406 | |
| 407 | function entryDraft(entryPoints: readonly SymbolSearchHit[], rank: number): Draft[] { |
| 408 | if (entryPoints.length === 0) { |
| 409 | return []; |
| 410 | } |
| 411 | const names = entryPoints.map((hit) => { |
| 412 | const where = hit.filePath === undefined |
| 413 | ? '' |
| 414 | : ` (${hit.filePath}${hit.line === undefined ? '' : `:${hit.line}`})`; |
| 415 | return `${hit.name}${where}`; |
| 416 | }); |
| 417 | const first = entryPoints[0]; |
| 418 | const source: CardSource = { name: first.name }; |
| 419 | if (first.qualifiedName !== undefined) { |
| 420 | source.qualifiedName = first.qualifiedName; |
| 421 | } |
| 422 | if (first.filePath !== undefined) { |
| 423 | source.filePath = first.filePath; |
| 424 | } |
| 425 | if (first.line !== undefined) { |
| 426 | source.line = first.line; |
| 427 | } |
| 428 | return [{ |
| 429 | kind: 'entry', |
| 430 | lines: [`The index flags these symbols as entry points: ${listOf(names)}.`], |
| 431 | source, |
| 432 | rank, |
| 433 | }]; |
| 434 | } |
| 435 | |
| 436 | function overviewDrafts(packet: FactPacket, rank: number): Draft[] { |
| 437 | const facts = packet.overview; |
no test coverage detected