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

Function routineHeaderAt

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

234
235/** The line of the nearest routine header at column 0 at or above a line, else the line itself. */
236function routineHeaderAt(filePath: string, line: number, context: ResolutionContext): number {
237 headerClassAt(filePath, line, context);
238 const headers = memos(context).headerClasses.get(filePath) ?? [];
239 let found = line;
240 for (const h of headers) {
241 if (h.line > line) break;
242 if (h.routine) found = h.line;
243 }
244 return found;
245}
246
247/**
248 * Whether a declaration is inside an `{$IFDEF}`, `{$IFNDEF}`, `{$IF}` or

Callers 1

declaredInRoutineFunction · 0.85

Calls 3

headerClassAtFunction · 0.85
memosFunction · 0.85
getMethod · 0.65

Tested by

no test coverage detected