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)
| 234 | |
| 235 | /** The line of the nearest routine header at column 0 at or above a line, else the line itself. */ |
| 236 | function 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 |
no test coverage detected