233
return;
234
}
236
>
try {
237
>
const parsed = JSON.parse(raw);
238
if (!Array.isArray(parsed) || parsed.length === 0) {
239
return;
240
}
242
>
const migrated: IStoredInstalledPlugin[] = (revive(parsed) as { pluginUri: UriComponents; plugin?: { name?: string; marketplaceReference?: { rawValue?: string } } }[]).map(entry => {
243
>
const uri = URI.revive(entry.pluginUri);
244
>
const rebased = this._rebasePluginUri(uri);
245
>
return {
246
>
pluginUri: rebased ?? uri,
247
>
marketplace: entry.plugin?.marketplaceReference?.rawValue ?? '',
248
>
name: entry.plugin?.name,
249
>
};
250
>
}).filter(e => !!e.marketplace);
251
>
252
>
this._logService.info(`[FileBackedInstalledPluginsStore] Migrating ${migrated.length} plugin(s) from storage to installed.json`);
253
>
254
>
// Set in memory and persist to file before removing legacy keys.
255
>
this._setValue(migrated, undefined, false);
256
>
const didPersist = await this._writeToFile();
257
>
if (!didPersist) {
258
return;
259
}