Skip to content

Commit 3c4afb7

Browse files
committed
Rework ext install flow a bit
1 parent c364d3a commit 3c4afb7

1 file changed

Lines changed: 19 additions & 8 deletions

File tree

src/vs/workbench/parts/extensions/node/extensionsWorkbenchService.ts

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -811,14 +811,25 @@ export class ExtensionsWorkbenchService implements IExtensionsWorkbenchService {
811811
}
812812

813813
const extension = result.firstPage[0];
814-
const promises = [this.open(extension)];
815-
816-
if (this.local.every(local => local.id !== extension.id)) {
817-
promises.push(this.install(extension));
818-
}
819-
820-
TPromise.join(promises)
821-
.done(null, error => this.onError(error));
814+
this.open(extension).then(() => {
815+
const message = nls.localize('installConfirmation', "Would you like to install the '{0}' extension?", extension.displayName, extension.publisher);
816+
const options = [
817+
nls.localize('install', "Install"),
818+
nls.localize('cancel', "Cancel")
819+
];
820+
this.choiceService.choose(Severity.Info, message, options, 2, false)
821+
.then<void>(value => {
822+
if (value === 0) {
823+
const promises: TPromise<any>[] = [];
824+
if (this.local.every(local => local.id !== extension.id)) {
825+
promises.push(this.install(extension));
826+
}
827+
828+
TPromise.join(promises)
829+
.done(null, error => this.onError(error));
830+
}
831+
});
832+
});
822833
});
823834
}
824835

0 commit comments

Comments
 (0)