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

Method before

src/resolution/parameter-flow.ts:513–527  ·  view source on GitHub ↗

Call with each file a sync is about to change or remove, while its rows are there to read.

(file: string)

Source from the content-addressed store, hash-verified

511
512 /** Call with each file a sync is about to change or remove, while its rows are there to read. */
513 before(file: string): void {
514 const language = detectLanguage(file);
515 if (!LANGUAGES.some((l) => l.language === language)) return;
516 const flows = this.queries.parameterFlows;
517 let changed = this.languages.get(language);
518 if (!changed) {
519 // Taken rather than read: a sync that stops short of its pass leaves no
520 // record, and the next one starts over rather than trust a stale count.
521 changed = { record: this.settled ? parseRecord(flows.getRecord(language)) : null, before: new Map() };
522 flows.setRecord(language, '');
523 this.languages.set(language, changed);
524 }
525 if (changed.before.size >= MAX_CHANGED_FILES) changed.record = null;
526 if (changed.record && !changed.before.has(file)) changed.before.set(file, flows.getFlowFacts(file));
527 }
528}
529
530function referenceOf(site: CallSiteRow, language: Language): UnresolvedReference & { filePath: string; language: Language } {

Callers 2

syncMethod · 0.80
indexFunction · 0.80

Calls 8

detectLanguageFunction · 0.90
parseRecordFunction · 0.85
getRecordMethod · 0.80
setRecordMethod · 0.80
hasMethod · 0.80
getFlowFactsMethod · 0.80
getMethod · 0.65
setMethod · 0.45

Tested by 1

indexFunction · 0.64