Load call graphs from persistent storage
()
| 100 | |
| 101 | /** Load call graphs from persistent storage */ |
| 102 | function loadCallGraphsFromStorage(): void { |
| 103 | if (!extensionContext) return; |
| 104 | |
| 105 | try { |
| 106 | const stored = extensionContext.globalState.get(CALL_GRAPH_CACHE_KEY) as Record<string, SerializedCallGraph> | undefined; |
| 107 | if (stored) { |
| 108 | cachedCallGraphs.clear(); |
| 109 | for (const [key, value] of Object.entries(stored)) { |
| 110 | cachedCallGraphs.set(key, deserializeCallGraph(value)); |
| 111 | } |
| 112 | console.log(`[CallGraph] Loaded ${cachedCallGraphs.size} cached call graphs`); |
| 113 | } |
| 114 | } catch (e) { |
| 115 | console.error('[CallGraph] Failed to load from storage:', e); |
| 116 | } |
| 117 | } |
| 118 | |
| 119 | /** Save call graphs to persistent storage (debounced) */ |
| 120 | let saveTimeout: NodeJS.Timeout | null = null; |
no test coverage detected