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

Function classOfCall

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

* The class whose method makes a call: the one the nearest method header * above the call names in the source text (`procedure TFoo.Bar;`), which holds * where the tree had errors and gave the code to the file, or to a routine * that swallowed the ones after it; else the reference's method's clas

(ref: UnresolvedRef, context: ResolutionContext)

Source from the content-addressed store, hash-verified

765 * ancestors include the type it helps (see ancestorsOf).
766 */
767function classOfCall(ref: UnresolvedRef, context: ResolutionContext): Node | null {
768 const qn = headerClassAt(ref.filePath!, ref.line, context);
769 const cls = qn ? classByQualifiedName(qn, ref.filePath!, context) : null;
770 if (cls) return cls;
771 const routine = context.getNodeById?.(ref.fromNodeId);
772 return routine?.kind === 'method' ? classOfRoutine(routine, context) : null;
773}
774
775/**
776 * Whether what a file's code sees is known: a unit's or a program's file,

Callers 7

matchPascalSystemCallFunction · 0.85
gatePascalCallFunction · 0.85
gatePascalDataCallFunction · 0.85
matchPascalNestedCallFunction · 0.85
gatePascalNestedTargetFunction · 0.85
withSubjectMemberFunction · 0.85
matchPascalHelperCallFunction · 0.85

Calls 4

headerClassAtFunction · 0.85
classByQualifiedNameFunction · 0.85
classOfRoutineFunction · 0.85
getNodeByIdMethod · 0.65

Tested by

no test coverage detected