* 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[])
| 1111 | * re-parsing most of the project inside a watcher's sync. |
| 1112 | */ |
| 1113 | private followDetectedFrameworks(detected: string[]): void { |
| 1114 | const now = [...detected].sort(); |
| 1115 | const resolverNow = [...this.resolver.getDetectedFrameworks()].sort(); |
| 1116 | if (now.join('\0') !== resolverNow.join('\0')) this.resolver.initialize(); |
| 1117 | try { |
| 1118 | const atIndex = parseNameList(this.queries.getMetadata(FRAMEWORKS_AT_INDEX_KEY)); |
| 1119 | if (!atIndex) return; // indexed before this was recorded: nothing to compare with |
| 1120 | const added = now.filter((name) => !atIndex.includes(name)); |
| 1121 | const removed = atIndex.filter((name) => !now.includes(name)); |
| 1122 | const value = added.length > 0 || removed.length > 0 ? JSON.stringify({ added, removed }) : ''; |
| 1123 | if ((this.queries.getMetadata(FRAMEWORKS_SINCE_INDEX_KEY) ?? '') !== value) { |
| 1124 | this.queries.setMetadata(FRAMEWORKS_SINCE_INDEX_KEY, value); |
| 1125 | } |
| 1126 | } catch { /* metadata is advisory */ } |
| 1127 | } |
| 1128 | |
| 1129 | /** |
| 1130 | * The frameworks that came or went since the last full index (#2516): files |
no test coverage detected