MCPcopy Create free account
hub / github.com/codag-megalith/codag-visualizer / loadCallGraphsFromStorage

Function loadCallGraphsFromStorage

frontend/src/analysis/state.ts:102–117  ·  view source on GitHub ↗

Load call graphs from persistent storage

()

Source from the content-addressed store, hash-verified

100
101/** Load call graphs from persistent storage */
102function 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) */
120let saveTimeout: NodeJS.Timeout | null = null;

Callers 1

initCallGraphPersistenceFunction · 0.85

Calls 4

deserializeCallGraphFunction · 0.85
setMethod · 0.80
getMethod · 0.45
clearMethod · 0.45

Tested by

no test coverage detected