(analysis: FileAnalysis)
| 15 | } |
| 16 | |
| 17 | function formatSignatureBlock(analysis: FileAnalysis): string { |
| 18 | const lines: string[] = []; |
| 19 | |
| 20 | if (analysis.header) { |
| 21 | lines.push(`// ${analysis.header}`); |
| 22 | lines.push(""); |
| 23 | } |
| 24 | |
| 25 | for (const sym of analysis.symbols) { |
| 26 | lines.push(`[${sym.kind}] ${formatLineRange(sym.line, sym.endLine)} ${sym.signature};`); |
| 27 | for (const child of sym.children) { |
| 28 | lines.push(` [${child.kind}] ${formatLineRange(child.line, child.endLine)} ${child.signature};`); |
| 29 | } |
| 30 | if (sym.children.length > 0) lines.push(""); |
| 31 | } |
| 32 | |
| 33 | return lines.join("\n"); |
| 34 | } |
| 35 | |
| 36 | export async function getFileSkeleton(options: SkeletonOptions): Promise<string> { |
| 37 | const fullPath = resolve(options.rootDir, options.filePath); |
no test coverage detected