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

Function declarationOf

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

* The class declaration among same-named nodes, not a forward declaration * (`TFoo = class;`, which names no members or ancestors): the longest one.

(classes: Node[])

Source from the content-addressed store, hash-verified

717 * (`TFoo = class;`, which names no members or ancestors): the longest one.
718 */
719function declarationOf(classes: Node[]): Node | null {
720 let best: Node | null = null;
721 for (const c of classes) if (!best || c.endLine - c.startLine > best.endLine - best.startLine) best = c;
722 return best;
723}
724
725/** The class a method belongs to: its qualified name's owner, declared in the method's own file. */
726function classOfRoutine(routine: Node, context: ResolutionContext): Node | null {

Callers 3

classByQualifiedNameFunction · 0.85
classOfRoutineFunction · 0.85
classThroughAliasesFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected