MCPcopy
hub / github.com/colbymchenry/codegraph / pascalFormEdges

Function pascalFormEdges

src/resolution/callback-synthesizer.ts:1591–1611  ·  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)

Source from the content-addressed store, hash-verified

1589 * definition isn't orphaned, and editing the form surfaces its code-behind unit.
1590 */
1591function pascalFormEdges(ctx: ResolutionContext): Edge[] {
1592 const edges: Edge[] = [];
1593 const allFiles = new Set(ctx.getAllFiles());
1594 for (const file of allFiles) {
1595 if (!/\.(dfm|fmx)$/i.test(file)) continue;
1596 const pasFile = file.replace(/\.(dfm|fmx)$/i, '.pas');
1597 if (!allFiles.has(pasFile)) continue;
1598 const formNode = ctx.getNodesInFile(file).find((n) => n.kind === 'file');
1599 const unitNode = ctx.getNodesInFile(pasFile).find((n) => n.kind === 'file');
1600 if (!formNode || !unitNode) continue;
1601 edges.push({
1602 source: unitNode.id,
1603 target: formNode.id,
1604 kind: 'references',
1605 line: unitNode.startLine,
1606 provenance: 'heuristic',
1607 metadata: { synthesizedBy: 'pascal-form', registeredAt: pasFile },
1608 });
1609 }
1610 return edges;
1611}
1612
1613/**
1614 * SvelteKit file-convention data flow. A route directory's `+page.svelte` (a

Callers 1

synthesizeCallbackEdgesFunction · 0.85

Calls 3

hasMethod · 0.80
getAllFilesMethod · 0.65
getNodesInFileMethod · 0.65

Tested by

no test coverage detected