The files of the units a file uses, in the order its `uses` clauses name them.
(fromFile: string, context: ResolutionContext)
| 839 | |
| 840 | /** The files of the units a file uses, in the order its `uses` clauses name them. */ |
| 841 | function usedUnitFiles(fromFile: string, context: ResolutionContext): string[] { |
| 842 | const memo = memos(context).usedFiles; |
| 843 | const hit = memo.get(fromFile); |
| 844 | if (hit) return hit; |
| 845 | // The unit's `uses` clauses, then those of the files it includes: mORMot's |
| 846 | // `.inc` files open the unit's implementation with one. |
| 847 | const unit = unitFilesOf(fromFile, context); |
| 848 | const files: string[] = []; |
| 849 | for (const own of unit) { |
| 850 | for (const imp of outlineOf(own, context).imports) { |
| 851 | const file = unitFileNamed(imp.name.toLowerCase(), own, context); |
| 852 | if (file && !unit.includes(file) && !files.includes(file)) files.push(file); |
| 853 | } |
| 854 | } |
| 855 | memo.set(fromFile, files); |
| 856 | return files; |
| 857 | } |
| 858 | |
| 859 | /** The unit's own declaration of a name, seen from one of its files (see ownUnitFiles). */ |
| 860 | function ownUnitDeclaration(fromFile: string, lower: string, context: ResolutionContext): Node | undefined { |
no test coverage detected