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

Method followDetectedFrameworks

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

1090 * re-parsing most of the project inside a watcher's sync.
1091 */
1092 private followDetectedFrameworks(detected: string[]): void {
1093 const now = [...detected].sort();
1094 const resolverNow = [...this.resolver.getDetectedFrameworks()].sort();
1095 if (now.join('\0') !== resolverNow.join('\0')) this.resolver.initialize();
1096 try {
1097 const atIndex = parseNameList(this.queries.getMetadata(FRAMEWORKS_AT_INDEX_KEY));
1098 if (!atIndex) return; // indexed before this was recorded: nothing to compare with
1099 const added = now.filter((name) => !atIndex.includes(name));
1100 const removed = atIndex.filter((name) => !now.includes(name));
1101 const value = added.length > 0 || removed.length > 0 ? JSON.stringify({ added, removed }) : '';
1102 if ((this.queries.getMetadata(FRAMEWORKS_SINCE_INDEX_KEY) ?? '') !== value) {
1103 this.queries.setMetadata(FRAMEWORKS_SINCE_INDEX_KEY, value);
1104 }
1105 } catch { /* metadata is advisory */ }
1106 }
1107
1108 /**
1109 * 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