| 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; |