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

Function routineHeaderAt

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

The line of the nearest routine header at column 0 at or above a line, else the line itself.

(filePath: string, line: number, context: ResolutionContext)

Source from the content-addressed store, hash-verified

716
717/** The line of the nearest routine header at column 0 at or above a line, else the line itself. */
718function routineHeaderAt(filePath: string, line: number, context: ResolutionContext): number {
719 headerClassAt(filePath, line, context);
720 const headers = memos(context).headerClasses.get(filePath) ?? [];
721 let found = line;
722 for (const h of headers) {
723 if (h.line > line) break;
724 if (h.routine) found = h.line;
725 }
726 return found;
727}
728
729/**
730 * Whether a declaration is inside an `{$IFDEF}`, `{$IFNDEF}`, `{$IF}` or

Callers 4

declaredAsLocalFunction · 0.85
declaredInRoutineFunction · 0.85
resultTypeTextFunction · 0.85
localTypeTextFunction · 0.85

Calls 3

headerClassAtFunction · 0.85
memosFunction · 0.85
getMethod · 0.65

Tested by

no test coverage detected