Skip to content

Commit

Permalink
Remove extension from disabled list after uninstall
Browse files Browse the repository at this point in the history
  • Loading branch information
sandy081 committed Oct 19, 2016
1 parent 8102ed5 commit 37c04d7
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/vs/platform/extensions/common/extensions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,5 +90,5 @@ export interface IExtensionsRuntimeService {
*
* Throws error if enablement is requested for workspace and there is no workspace
*/
setEnablement(identifier: string, enable: boolean, displayName: string, workspace?: boolean): TPromise<boolean>;
setEnablement(identifier: string, enable: boolean, workspace?: boolean): TPromise<boolean>;
}
Original file line number Diff line number Diff line change
Expand Up @@ -481,7 +481,7 @@ export class ExtensionsWorkbenchService implements IExtensionsWorkbenchService {
}

setEnablement(extension: IExtension, enable: boolean, workspace: boolean = false): TPromise<any> {
return this.extensionsRuntimeService.setEnablement(extension.identifier, enable, extension.displayName, workspace).then(restart => {
return this.extensionsRuntimeService.setEnablement(extension.identifier, enable, workspace).then(restart => {
(<Extension>extension).needsReload = restart;
this.telemetryService.publicLog(enable ? 'extension:enable' : 'extension:disable', extension.telemetryData);
this._onChange.fire();
Expand Down Expand Up @@ -585,6 +585,7 @@ export class ExtensionsWorkbenchService implements IExtensionsWorkbenchService {

private onDidUninstallExtension({id, error}: DidUninstallExtensionEvent): void {
if (!error) {
this.newlyInstalled = this.newlyInstalled.filter(e => e.local.id !== id);
this.installed = this.installed.filter(e => e.local.id !== id);
}

Expand All @@ -596,9 +597,11 @@ export class ExtensionsWorkbenchService implements IExtensionsWorkbenchService {

if (!error) {
this.unInstalled.push(uninstalling.extension);
this.extensionsRuntimeService.setEnablement(uninstalling.extension.identifier, true);
uninstalling.extension.needsReload = true;
this.reportTelemetry(uninstalling, true);
}

this._onChange.fire();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ export class ExtensionsRuntimeService implements IExtensionsRuntimeService {
});
}

public setEnablement(identifier: string, enable: boolean, displayName: string, workspace: boolean = false): TPromise<boolean> {
public setEnablement(identifier: string, enable: boolean, workspace: boolean = false): TPromise<boolean> {
const disabled = this.getDisabledExtensionsFromStorage().indexOf(identifier) !== -1;

if (!enable === disabled) {
Expand Down

0 comments on commit 37c04d7

Please sign in to comment.