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

Function usedUnitFiles

src/resolution/pascal-scope.ts:841–857  ·  view source on GitHub ↗

The files of the units a file uses, in the order its `uses` clauses name them.

(fromFile: string, context: ResolutionContext)

Source from the content-addressed store, hash-verified

839
840/** The files of the units a file uses, in the order its `uses` clauses name them. */
841function 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). */
860function ownUnitDeclaration(fromFile: string, lower: string, context: ResolutionContext): Node | undefined {

Callers 3

declarationInScopeFunction · 0.85
headOfFunction · 0.85
visibleFunction · 0.85

Calls 7

memosFunction · 0.85
unitFilesOfFunction · 0.85
outlineOfFunction · 0.85
unitFileNamedFunction · 0.85
pushMethod · 0.80
getMethod · 0.65
setMethod · 0.45

Tested by

no test coverage detected