608
609
addInstalledPlugin(pluginUri: URI, plugin: IMarketplacePlugin): void {
611
>
const entry: IStoredInstalledPlugin = {
612
>
pluginUri,
613
>
marketplace: plugin.marketplaceReference.rawValue,
614
>
name: plugin.name,
615
>
};
616
>
const current = this._installedPluginsStore.get();
617
>
const existing = current.find(e => isEqual(e.pluginUri, pluginUri));
618
>
if (existing) {
619
// Still update to trigger watchers to re-check, something might have happened that we want to know about
620
this._installedPluginsStore.set(current.map(c => c === existing ? entry : c), undefined);
622
>
this._installedPluginsStore.set([...current, entry], undefined);
623
>
}
624
>
}
625
626
removeInstalledPlugin(pluginUri: URI): void {