MCPcopy Index your code
hub / github.com/forloopcodes/contextplus / formatSignatureBlock

Function formatSignatureBlock

src/tools/file-skeleton.ts:17–34  ·  view source on GitHub ↗
(analysis: FileAnalysis)

Source from the content-addressed store, hash-verified

15}
16
17function 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
36export async function getFileSkeleton(options: SkeletonOptions): Promise<string> {
37 const fullPath = resolve(options.rootDir, options.filePath);

Callers 1

getFileSkeletonFunction · 0.85

Calls 1

formatLineRangeFunction · 0.70

Tested by

no test coverage detected