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

Function flattenSymbols

src/core/parser.ts:385–401  ·  view source on GitHub ↗
(symbols: CodeSymbol[], parentName?: string)

Source from the content-addressed store, hash-verified

383}
384
385export function flattenSymbols(symbols: CodeSymbol[], parentName?: string): SymbolLocation[] {
386 const out: SymbolLocation[] = [];
387 for (const sym of symbols) {
388 out.push({
389 name: sym.name,
390 kind: sym.kind,
391 line: sym.line,
392 endLine: sym.endLine,
393 signature: sym.signature,
394 parentName,
395 });
396 if (sym.children.length > 0) {
397 out.push(...flattenSymbols(sym.children, sym.name));
398 }
399 }
400 return out;
401}

Callers 4

semanticNavigateFunction · 0.85
buildIdentifierIndexFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected