107
108
private async _initialize(): Promise<void> {
110
>
const read = await this._readFromFile();
111
>
if (read !== undefined) {
112
this._setValue(read, undefined, false);
114
// No installed.json yet — attempt migration from legacy storage.
115
await this._migrateFromStorage();
116
}
118
this._logService.error('[FileBackedInstalledPluginsStore] Initialization failed', error);
119
}
121
>
this._initialized = true;
122
>
this._setupFileWatcher();
123
>
}
124
125
// --- File I/O ----------------------------------------------------------------
126
127
private async _readFromFile(): Promise<readonly IStoredInstalledPlugin[] | undefined> {
129
>
const exists = await this._fileService.exists(this._fileUri);
130
if (!exists) {
131
return undefined;