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

Function memberThroughPath

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

* A dotted name: the method its receiver's declared type has; with * `holdsRoutine`, data that holds a routine too (a chain called with its * arguments, `Owner.Events.FOnChange(Self)`, see isProceduralData).

(path: string[], cls: Node | null, ref: UnresolvedRef, context: ResolutionContext, holdsRoutine = false)

Source from the content-addressed store, hash-verified

1026 * arguments, `Owner.Events.FOnChange(Self)`, see isProceduralData).
1027 */
1028function memberThroughPath(path: string[], cls: Node | null, ref: UnresolvedRef, context: ResolutionContext, holdsRoutine = false): Found | null {
1029 const last = memberAtPath(path, cls, ref, context);
1030 if (!last) return null;
1031 if (!isRoutine(last.node) && !(holdsRoutine && DATA_KINDS.has(last.node.kind) && isProceduralData(last.node, context))) return null;
1032 return { node: last.node, resolvedBy: last.unit ? 'import' : 'instance-method', confidence: 0.9 };
1033}
1034
1035/**
1036 * What a dotted name's last link is declared as: a member of what the links

Callers 1

matchPascalParenlessRefFunction · 0.85

Calls 4

memberAtPathFunction · 0.85
isRoutineFunction · 0.85
isProceduralDataFunction · 0.85
hasMethod · 0.80

Tested by

no test coverage detected