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

Method initializeCache

frontend/src/cache.ts:125–143  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

123 }
124
125 private async initializeCache() {
126 const workspaceFolders = vscode.workspace.workspaceFolders;
127 if (!workspaceFolders || workspaceFolders.length === 0) {
128 return;
129 }
130
131 const workspaceFolder = workspaceFolders[0];
132 const vscodeFolderPath = path.join(workspaceFolder.uri.fsPath, '.vscode');
133 this.cachePath = vscode.Uri.file(path.join(vscodeFolderPath, 'codag-cache.json'));
134 this.graphPath = vscode.Uri.file(path.join(vscodeFolderPath, 'codag-graph.json'));
135
136 try {
137 await vscode.workspace.fs.createDirectory(vscode.Uri.file(vscodeFolderPath));
138 } catch (error) {
139 // Directory might already exist
140 }
141
142 await this.loadCache();
143 }
144
145 private async loadCache() {
146 if (!this.cachePath) return;

Callers 1

constructorMethod · 0.95

Calls 1

loadCacheMethod · 0.95

Tested by

no test coverage detected