* The class whose method makes a call: the one the nearest method header * above the call names in the source text (`procedure TFoo.Bar;`), which holds * where the tree had errors and gave the code to the file, or to a routine * that swallowed the ones after it; else the reference's method's clas
(ref: UnresolvedRef, context: ResolutionContext)
| 281 | * that swallowed the ones after it; else the reference's method's class. |
| 282 | */ |
| 283 | function classOfCall(ref: UnresolvedRef, context: ResolutionContext): Node | null { |
| 284 | const qn = headerClassAt(ref.filePath!, ref.line, context); |
| 285 | const cls = qn ? classByQualifiedName(qn, ref.filePath!, context) : null; |
| 286 | if (cls) return cls; |
| 287 | const routine = context.getNodeById?.(ref.fromNodeId); |
| 288 | return routine?.kind === 'method' ? classOfRoutine(routine, context) : null; |
| 289 | } |
| 290 | |
| 291 | /** |
| 292 | * The class the nearest routine header at or above a line names |
no test coverage detected