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

Method followDetectedFrameworks

src/index.ts:1077–1091  ·  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

1075 * re-parsing most of the project inside a watcher's sync.
1076 */
1077 private followDetectedFrameworks(detected: string[]): void {
1078 const now = [...detected].sort();
1079 const resolverNow = [...this.resolver.getDetectedFrameworks()].sort();
1080 if (now.join('\0') !== resolverNow.join('\0')) this.resolver.initialize();
1081 try {
1082 const atIndex = parseNameList(this.queries.getMetadata(FRAMEWORKS_AT_INDEX_KEY));
1083 if (!atIndex) return; // indexed before this was recorded: nothing to compare with
1084 const added = now.filter((name) => !atIndex.includes(name));
1085 const removed = atIndex.filter((name) => !now.includes(name));
1086 const value = added.length > 0 || removed.length > 0 ? JSON.stringify({ added, removed }) : '';
1087 if ((this.queries.getMetadata(FRAMEWORKS_SINCE_INDEX_KEY) ?? '') !== value) {
1088 this.queries.setMetadata(FRAMEWORKS_SINCE_INDEX_KEY, value);
1089 }
1090 } catch { /* metadata is advisory */ }
1091 }
1092
1093 /**
1094 * 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