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

Function callerOf

__tests__/pascal-implementation-matching.test.ts:28–32  ·  view source on GitHub ↗

The qualified name of the routine a call of `name` is made from, or the file's name.

(source: string, name: string)

Source from the content-addressed store, hash-verified

26}
27/** The qualified name of the routine a call of `name` is made from, or the file's name. */
28function callerOf(source: string, name: string): string | undefined {
29 const result = extract(source);
30 const ref = result.unresolvedReferences.find((r) => r.referenceName === name);
31 return result.nodes.find((n) => n.id === ref?.fromNodeId)?.qualifiedName;
32}
33
34describe('Pascal implementations find their declarations (#3453)', () => {
35 it('gives the body to the first of two declarations that {$IFDEF} branches write alike', () => {

Calls 1

extractFunction · 0.70

Tested by

no test coverage detected