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

Function fileScopeRefsWithin

src/ui-server/api/steps.ts:1689–1701  ·  view source on GitHub ↗

The file scope's unresolved calls within a value's lines — what a wrapped handler's arrow body leaves on the file node.

(cg: CodeGraph, node: Node, memo: Map<string, UnresolvedReference[]>)

Source from the content-addressed store, hash-verified

1687
1688/** The file scope's unresolved calls within a value's lines — what a wrapped handler's arrow body leaves on the file node. */
1689function fileScopeRefsWithin(cg: CodeGraph, node: Node, memo: Map<string, UnresolvedReference[]>): UnresolvedReference[] {
1690 let refs = memo.get(node.filePath);
1691 if (refs === undefined) {
1692 const file = cg.getNodesInFile(node.filePath).find((n) => n.kind === 'file');
1693 try {
1694 refs = file ? cg.getUnresolvedReferencesFrom(file.id) : [];
1695 } catch {
1696 refs = [];
1697 }
1698 memo.set(node.filePath, refs);
1699 }
1700 return refs.filter((r) => r.line >= node.startLine && r.line <= node.endLine);
1701}
1702
1703/** `push /capture`, `renders <Button>`, `via rn-event-channel`, `calls`. */
1704function siteText(edge: Edge, meta: Record<string, unknown>, target: Node): string {

Callers 1

buildStepsFunction · 0.85

Calls 4

getMethod · 0.65
getNodesInFileMethod · 0.65
setMethod · 0.45

Tested by

no test coverage detected