提交 6a95d97a 编写于 作者: S Sandeep Somavarapu

#38609 Show cancelled message on cancel

上级 ace285a4
...@@ -37,6 +37,7 @@ import { IStateService } from 'vs/platform/state/common/state'; ...@@ -37,6 +37,7 @@ import { IStateService } from 'vs/platform/state/common/state';
import { StateService } from 'vs/platform/state/node/stateService'; import { StateService } from 'vs/platform/state/node/stateService';
import { createLogService } from 'vs/platform/log/node/spdlogService'; import { createLogService } from 'vs/platform/log/node/spdlogService';
import { registerGlobalLogService, ILogService } from 'vs/platform/log/common/log'; import { registerGlobalLogService, ILogService } from 'vs/platform/log/common/log';
import { isPromiseCanceledError } from 'vs/base/common/errors';
const notFound = (id: string) => localize('notFound', "Extension '{0}' not found.", id); const notFound = (id: string) => localize('notFound', "Extension '{0}' not found.", id);
const notInstalled = (id: string) => localize('notInstalled', "Extension '{0}' is not installed.", id); const notInstalled = (id: string) => localize('notInstalled', "Extension '{0}' is not installed.", id);
...@@ -97,6 +98,13 @@ class Main { ...@@ -97,6 +98,13 @@ class Main {
return this.extensionManagementService.install(extension).then(() => { return this.extensionManagementService.install(extension).then(() => {
console.log(localize('successVsixInstall', "Extension '{0}' was successfully installed!", getBaseLabel(extension))); console.log(localize('successVsixInstall', "Extension '{0}' was successfully installed!", getBaseLabel(extension)));
}, error => {
if (isPromiseCanceledError(error)) {
console.log(localize('cancelVsixInstall', "Cancelled installing Extension '{0}'.", getBaseLabel(extension)));
return null;
} else {
return TPromise.wrapError(error);
}
}); });
}); });
...@@ -135,7 +143,16 @@ class Main { ...@@ -135,7 +143,16 @@ class Main {
console.log(localize('installing', "Installing...")); console.log(localize('installing', "Installing..."));
return this.extensionManagementService.installFromGallery(extension) return this.extensionManagementService.installFromGallery(extension)
.then(() => console.log(localize('successInstall', "Extension '{0}' v{1} was successfully installed!", id, extension.version))); .then(
() => console.log(localize('successInstall', "Extension '{0}' v{1} was successfully installed!", id, extension.version)),
error => {
if (isPromiseCanceledError(error)) {
console.log(localize('cancelVsixInstall', "Cancelled installing Extension '{0}'.", id));
return null;
} else {
return TPromise.wrapError(error);
}
});
}); });
}); });
}); });
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册