提交 57f5084e 编写于 作者: J Joao Moreno

warn about obsolete when installing

fixes #3470
上级 ebd65a65
......@@ -119,7 +119,13 @@ export class ExtensionsService implements IExtensionsService {
return this.installFromZip(arg);
}
return this.installFromGallery(arg);
return this.isObsolete(arg as IExtension).then(obsolete => {
if (obsolete) {
return TPromise.wrapError(new Error(nls.localize('restartCode', "Please restart Code before reinstalling {0}.", extension.name)));
}
return this.installFromGallery(arg);
});
}
private installFromGallery(extension: IExtension): TPromise<IExtension> {
......@@ -257,6 +263,11 @@ export class ExtensionsService implements IExtensionsService {
});
}
private isObsolete(extension: IExtension): TPromise<boolean> {
const id = getExtensionId(extension);
return this.withObsoleteExtensions(obsolete => !!obsolete[id]);
}
private setObsolete(extension: IExtension): TPromise<void> {
const id = getExtensionId(extension);
return this.withObsoleteExtensions(obsolete => assign(obsolete, { [id]: true }));
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册