* Initializes the cache manager by loading the cache file
()
| 36 | * Initializes the cache manager by loading the cache file |
| 37 | */ |
| 38 | async initialize(): Promise<void> { |
| 39 | try { |
| 40 | const cacheData = await vscode.workspace.fs.readFile(this.cachePath) |
| 41 | this.fileHashes = JSON.parse(cacheData.toString()) |
| 42 | } catch (error) { |
| 43 | this.fileHashes = {} |
| 44 | TelemetryService.instance.captureEvent(TelemetryEventName.CODE_INDEX_ERROR, { |
| 45 | error: error instanceof Error ? error.message : String(error), |
| 46 | stack: error instanceof Error ? error.stack : undefined, |
| 47 | location: "initialize", |
| 48 | }) |
| 49 | } |
| 50 | } |
| 51 | |
| 52 | /** |
| 53 | * Saves the cache to disk |
nothing calls this directly
no test coverage detected