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

Function projectFiles

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

951
952/** The project's files by lowercased name, and its Pascal sources. */
953function projectFiles(context: ResolutionContext): { byName: Map<string, string[]>; pascal: string[] } {
954 const m = memos(context);
955 if (!m.projectFiles) {
956 const byName = new Map<string, string[]>();
957 const pascal: string[] = [];
958 for (const file of context.getAllFiles()) {
959 const base = file.slice(file.lastIndexOf('/') + 1).toLowerCase();
960 const same = byName.get(base);
961 if (same) same.push(file);
962 else byName.set(base, [file]);
963 if (PASCAL_SOURCE.test(file)) pascal.push(file);
964 }
965 m.projectFiles = { byName, pascal };
966 }
967 return m.projectFiles;
968}
969
970/** The file of the unit a name names, nearest to `fromFile` when several units share it. */
971function unitFileNamed(lower: string, fromFile: string, context: ResolutionContext): string | null {

Callers 2

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