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

Method followDetectedFrameworks

src/index.ts:1087–1101  ·  view source on GitHub ↗

* A sync detected frameworks again because what detection read had changed * (#2516): a framework arrived mid-session, like Express in a new * `package.json`, or one left. Files the sync extracted were read with the * new set already. The resolver detects again when its set differs, so *

(detected: string[])

Source from the content-addressed store, hash-verified

1085 * re-parsing most of the project inside a watcher's sync.
1086 */
1087 private followDetectedFrameworks(detected: string[]): void {
1088 const now = [...detected].sort();
1089 const resolverNow = [...this.resolver.getDetectedFrameworks()].sort();
1090 if (now.join('\0') !== resolverNow.join('\0')) this.resolver.initialize();
1091 try {
1092 const atIndex = parseNameList(this.queries.getMetadata(FRAMEWORKS_AT_INDEX_KEY));
1093 if (!atIndex) return; // indexed before this was recorded: nothing to compare with
1094 const added = now.filter((name) => !atIndex.includes(name));
1095 const removed = atIndex.filter((name) => !now.includes(name));
1096 const value = added.length > 0 || removed.length > 0 ? JSON.stringify({ added, removed }) : '';
1097 if ((this.queries.getMetadata(FRAMEWORKS_SINCE_INDEX_KEY) ?? '') !== value) {
1098 this.queries.setMetadata(FRAMEWORKS_SINCE_INDEX_KEY, value);
1099 }
1100 } catch { /* metadata is advisory */ }
1101 }
1102
1103 /**
1104 * The frameworks that came or went since the last full index (#2516): files

Callers 1

syncMethod · 0.95

Calls 6

parseNameListFunction · 0.85
getMetadataMethod · 0.80
setMetadataMethod · 0.80
getDetectedFrameworksMethod · 0.45
joinMethod · 0.45
initializeMethod · 0.45

Tested by

no test coverage detected