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

Function ownUnitFiles

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

* The files whose declarations are a file's unit's own, the file first: the * unit is its own file and the include files it pulls in, so code in * `mormot.core.os.pas` sees a variable `mormot.core.os.posix.inc` declares, * and that file's code sees the unit's (see unitFilesOf).

(filePath: string, context: ResolutionContext)

Source from the content-addressed store, hash-verified

872 * and that file's code sees the unit's (see unitFilesOf).
873 */
874function ownUnitFiles(filePath: string, context: ResolutionContext): string[] {
875 const memo = memos(context).ownFiles;
876 let own = memo.get(filePath);
877 if (!own) {
878 const unit = unitFilesOf(filePath, context);
879 own = unit[0] === filePath ? unit : [filePath, ...unit.filter((f) => f !== filePath)];
880 memo.set(filePath, own);
881 }
882 return own;
883}
884
885/**
886 * The files one unit is made of: its own file, then the include files it

Callers 3

classByQualifiedNameFunction · 0.85
ownUnitDeclarationFunction · 0.85
visibleFunction · 0.85

Calls 4

memosFunction · 0.85
unitFilesOfFunction · 0.85
getMethod · 0.65
setMethod · 0.45

Tested by

no test coverage detected