MCPcopy Create free account
hub / github.com/colbymchenry/codegraph / nestedRoutineSpans

Function nestedRoutineSpans

src/resolution/pascal-scope.ts:1730–1740  ·  view source on GitHub ↗

The lines (first, last) of the routines a file nests in others.

(filePath: string, context: ResolutionContext)

Source from the content-addressed store, hash-verified

1728
1729/** The lines (first, last) of the routines a file nests in others. */
1730function nestedRoutineSpans(filePath: string, context: ResolutionContext): Array<[number, number]> {
1731 const memo = memos(context).nestedSpans;
1732 let spans = memo.get(filePath);
1733 if (!spans) {
1734 spans = context.getNodesInFile(filePath)
1735 .filter((n) => isNestedRoutine(n, context))
1736 .map((n): [number, number] => [n.startLine, n.endLine ?? n.startLine]);
1737 memo.set(filePath, spans);
1738 }
1739 return spans;
1740}
1741
1742/** Roots every class or interface has, whose members a call by name doesn't reach in the project. */
1743const IMPLICIT_ROOTS: ReadonlySet<string> = new Set(['tobject', 'tinterfacedobject', 'iinterface', 'iunknown', 'idispatch']);

Callers 2

declaredAsLocalFunction · 0.85
localTypeTextFunction · 0.85

Calls 6

memosFunction · 0.85
isNestedRoutineFunction · 0.85
mapMethod · 0.80
getMethod · 0.65
getNodesInFileMethod · 0.65
setMethod · 0.45

Tested by

no test coverage detected