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

Function ownUnitFiles

src/resolution/pascal-scope.ts:2410–2419  ·  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

2408 * and that file's code sees the unit's (see unitFilesOf).
2409 */
2410function ownUnitFiles(filePath: string, context: ResolutionContext): string[] {
2411 const memo = memos(context).ownFiles;
2412 let own = memo.get(filePath);
2413 if (!own) {
2414 const unit = unitFilesOf(filePath, context);
2415 own = unit[0] === filePath ? unit : [filePath, ...unit.filter((f) => f !== filePath)];
2416 memo.set(filePath, own);
2417 }
2418 return own;
2419}
2420
2421/**
2422 * The files one unit is made of: its own file, then the include files it

Callers 9

unitRoutineInScopeFunction · 0.85
helperVisibleFunction · 0.85
classByQualifiedNameFunction · 0.85
visibleClassNamedFunction · 0.85
nearestHelperFunction · 0.85
matchPascalHelperCallFunction · 0.85
unitDeclarationFunction · 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