* A unit's top-level declaration of a name (its enum values included), as * code in `fromFile` sees it: another unit's member that its parse lost (see * unitRoutineColumn) is not one, while in its own unit it is most likely the * member the code calls.
(filePath: string, lower: string, context: ResolutionContext, fromFile = filePath)
| 796 | * member the code calls. |
| 797 | */ |
| 798 | function unitDeclaration(filePath: string, lower: string, context: ResolutionContext, fromFile = filePath): Node | undefined { |
| 799 | const decls = pascalNamed(lower, context).filter((n) => |
| 800 | n.filePath === filePath && UNIT_KINDS.has(n.kind) && (n.kind === 'enum_member' || !n.qualifiedName.includes('::')) && |
| 801 | !(fromFile !== filePath && n.kind === 'function' && n.startColumn > unitRoutineColumn(filePath, context))); |
| 802 | // A routine declared in the interface and defined in the implementation is |
| 803 | // one name; of overloads, one called without arguments first. |
| 804 | return decls.find((n) => !isRoutine(n)) ?? decls.find((n) => !needsArguments(n)) ?? decls[0]; |
| 805 | } |
| 806 | |
| 807 | /** |
| 808 | * How far a unit's own routines are indented at most. In a unit whose |
no test coverage detected