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

Function declarationOf

src/resolution/pascal-scope.ts:1897–1901  ·  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

1895 * (`TFoo = class;`, which names no members or ancestors): the longest one.
1896 */
1897function declarationOf(classes: Node[]): Node | null {
1898 let best: Node | null = null;
1899 for (const c of classes) if (!best || c.endLine - c.startLine > best.endLine - best.startLine) best = c;
1900 return best;
1901}
1902
1903/** The class a method belongs to: its qualified name's owner, declared in the method's own file. */
1904function 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