MCPcopy Create free account
hub / github.com/Zoo-Code-Org/Zoo-Code / initialize

Method initialize

src/services/code-index/cache-manager.ts:38–50  ·  view source on GitHub ↗

* Initializes the cache manager by loading the cache file

()

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 5

parseMethod · 0.80
toStringMethod · 0.65
StringInterface · 0.50
readFileMethod · 0.45
captureEventMethod · 0.45

Tested by

no test coverage detected