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

Function pascalFormEdges

src/resolution/callback-synthesizer.ts:3667–3689  ·  view source on GitHub ↗

* Delphi form code-behind: a form unit `UFRMAbout.pas` owns its visual form * definition `UFRMAbout.dfm` (VCL) / `.fmx` (FireMonkey) — paired by basename in * the same directory, wired by the `{$R *.dfm}` directive rather than a `uses` * clause. Link the unit → its form so a `.dfm`/`.fmx` used on

(ctx: ResolutionContext, onYield: MaybeYield)

Source from the content-addressed store, hash-verified

3665 * definition isn't orphaned, and editing the form surfaces its code-behind unit.
3666 */
3667async function pascalFormEdges(ctx: ResolutionContext, onYield: MaybeYield): Promise<Edge[]> {
3668 let scannedFiles = 0;
3669 const edges: Edge[] = [];
3670 const allFiles = new Set(ctx.getAllFiles());
3671 for (const file of allFiles) {
3672 if ((++scannedFiles & 255) === 0) await onYield();
3673 if (!/\.(dfm|fmx)$/i.test(file)) continue;
3674 const pasFile = file.replace(/\.(dfm|fmx)$/i, '.pas');
3675 if (!allFiles.has(pasFile)) continue;
3676 const formNode = ctx.getNodesInFile(file).find((n) => n.kind === 'file');
3677 const unitNode = ctx.getNodesInFile(pasFile).find((n) => n.kind === 'file');
3678 if (!formNode || !unitNode) continue;
3679 edges.push({
3680 source: unitNode.id,
3681 target: formNode.id,
3682 kind: 'references',
3683 line: unitNode.startLine,
3684 provenance: 'heuristic',
3685 metadata: { synthesizedBy: 'pascal-form', registeredAt: pasFile },
3686 });
3687 }
3688 return edges;
3689}
3690
3691/**
3692 * SvelteKit file-convention data flow. A route directory's `+page.svelte` (a

Callers 1

Calls 4

hasMethod · 0.80
pushMethod · 0.80
getAllFilesMethod · 0.65
getNodesInFileMethod · 0.65

Tested by

no test coverage detected