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

Function projectFiles

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

The project's files by lowercased name, and its Pascal sources.

(context: ResolutionContext)

Source from the content-addressed store, hash-verified

2487
2488/** The project's files by lowercased name, and its Pascal sources. */
2489function projectFiles(context: ResolutionContext): { byName: Map<string, string[]>; pascal: string[] } {
2490 const m = memos(context);
2491 if (!m.projectFiles) {
2492 const byName = new Map<string, string[]>();
2493 const pascal: string[] = [];
2494 for (const file of context.getAllFiles()) {
2495 const base = file.slice(file.lastIndexOf('/') + 1).toLowerCase();
2496 const same = byName.get(base);
2497 if (same) same.push(file);
2498 else byName.set(base, [file]);
2499 if (PASCAL_SOURCE.test(file)) pascal.push(file);
2500 }
2501 m.projectFiles = { byName, pascal };
2502 }
2503 return m.projectFiles;
2504}
2505
2506/** The file of the unit a name names, nearest to `fromFile` when several units share it. */
2507function unitFileNamed(lower: string, fromFile: string, context: ResolutionContext): string | null {

Callers 4

scanInterfaceFunction · 0.85
unitsIncludedInUsesFunction · 0.85
includesOfFunction · 0.85
includerOfFunction · 0.85

Calls 5

memosFunction · 0.85
pushMethod · 0.80
getAllFilesMethod · 0.65
getMethod · 0.65
setMethod · 0.45

Tested by

no test coverage detected