( pluginId: string, scope: PersistableScope, projectPath?: string, )
| 450 | * @param projectPath - Project path (for project/local scopes) |
| 451 | */ |
| 452 | export function removePluginInstallation( |
| 453 | pluginId: string, |
| 454 | scope: PersistableScope, |
| 455 | projectPath?: string, |
| 456 | ): void { |
| 457 | const data = loadInstalledPluginsFromDisk() |
| 458 | const installations = data.plugins[pluginId] |
| 459 | |
| 460 | if (!installations) { |
| 461 | return |
| 462 | } |
| 463 | |
| 464 | data.plugins[pluginId] = installations.filter( |
| 465 | entry => !(entry.scope === scope && entry.projectPath === projectPath), |
| 466 | ) |
| 467 | |
| 468 | // Remove plugin entirely if no installations left |
| 469 | if (data.plugins[pluginId].length === 0) { |
| 470 | delete data.plugins[pluginId] |
| 471 | } |
| 472 | |
| 473 | saveInstalledPluginsV2(data) |
| 474 | logForDebugging(`Removed installation for ${pluginId} at scope ${scope}`) |
| 475 | } |
| 476 | |
| 477 | // ============================================================================= |
| 478 | // In-Memory vs Disk State Management (for non-in-place updates) |
no test coverage detected