(sym: CodeSymbol, indent: number = 0)
| 361 | } |
| 362 | |
| 363 | export function formatSymbol(sym: CodeSymbol, indent: number = 0): string { |
| 364 | const prefix = " ".repeat(indent); |
| 365 | const kindLabel = sym.kind === SymbolKind.Method ? "method" : sym.kind; |
| 366 | const lineLabel = sym.endLine > sym.line ? `L${sym.line}-L${sym.endLine}` : `L${sym.line}`; |
| 367 | let result = `${prefix}${kindLabel}: ${sym.name} (${lineLabel})`; |
| 368 | |
| 369 | if (sym.kind === SymbolKind.Function || sym.kind === SymbolKind.Method) { |
| 370 | result = `${prefix}${kindLabel}: ${sym.signature} (${lineLabel})`; |
| 371 | } |
| 372 | |
| 373 | for (const child of sym.children) { |
| 374 | result += "\n" + formatSymbol(child, indent + 1); |
| 375 | } |
| 376 | return result; |
| 377 | } |
| 378 | |
| 379 | export function isSupportedFile(filePath: string): boolean { |
| 380 | const ext = extname(filePath).toLowerCase(); |
no outgoing calls
no test coverage detected