* Clears the cache file by writing an empty object to it
()
| 69 | * Clears the cache file by writing an empty object to it |
| 70 | */ |
| 71 | async clearCacheFile(): Promise<void> { |
| 72 | try { |
| 73 | await safeWriteJson(this.cachePath.fsPath, {}) |
| 74 | this.fileHashes = {} |
| 75 | } catch (error) { |
| 76 | console.error("Failed to clear cache file:", error, this.cachePath) |
| 77 | TelemetryService.instance.captureEvent(TelemetryEventName.CODE_INDEX_ERROR, { |
| 78 | error: error instanceof Error ? error.message : String(error), |
| 79 | stack: error instanceof Error ? error.stack : undefined, |
| 80 | location: "clearCacheFile", |
| 81 | }) |
| 82 | } |
| 83 | } |
| 84 | |
| 85 | /** |
| 86 | * Gets the hash for a file path |
no test coverage detected