未验证 提交 e5d248c3 编写于 作者: J Joao Moreno

cleanup update product from command palette

上级 1e6cf75d
......@@ -8,8 +8,10 @@ import { Registry } from 'vs/platform/registry/common/platform';
import { IWorkbenchContributionsRegistry, Extensions as WorkbenchExtensions } from 'vs/workbench/common/contributions';
import { IWorkbenchActionRegistry, Extensions as ActionExtensions } from 'vs/workbench/common/actions';
import { SyncActionDescriptor } from 'vs/platform/actions/common/actions';
import { ShowCurrentReleaseNotesAction, ProductContribution, UpdateContribution, CheckForVSCodeUpdateAction } from 'vs/workbench/contrib/update/browser/update';
import { ShowCurrentReleaseNotesAction, ProductContribution, UpdateContribution, CheckForVSCodeUpdateAction, CONTEXT_UPDATE_STATE } from 'vs/workbench/contrib/update/browser/update';
import { LifecyclePhase } from 'vs/platform/lifecycle/common/lifecycle';
import product from 'vs/platform/product/common/product';
import { StateType } from 'vs/platform/update/common/update';
const workbench = Registry.as<IWorkbenchContributionsRegistry>(WorkbenchExtensions.Workbench);
......@@ -20,7 +22,7 @@ const actionRegistry = Registry.as<IWorkbenchActionRegistry>(ActionExtensions.Wo
// Editor
actionRegistry
.registerWorkbenchAction(new SyncActionDescriptor(ShowCurrentReleaseNotesAction, ShowCurrentReleaseNotesAction.ID, ShowCurrentReleaseNotesAction.LABEL), 'Show Release Notes');
.registerWorkbenchAction(new SyncActionDescriptor(ShowCurrentReleaseNotesAction, ShowCurrentReleaseNotesAction.ID, ShowCurrentReleaseNotesAction.LABEL), `${product.nameShort}: Show Release Notes`, product.nameShort);
actionRegistry
.registerWorkbenchAction(new SyncActionDescriptor(CheckForVSCodeUpdateAction, CheckForVSCodeUpdateAction.ID, CheckForVSCodeUpdateAction.LABEL), 'Check for VS Code Update');
.registerWorkbenchAction(new SyncActionDescriptor(CheckForVSCodeUpdateAction, CheckForVSCodeUpdateAction.ID, CheckForVSCodeUpdateAction.LABEL), `${product.nameShort}: Check for Update`, product.nameShort, CONTEXT_UPDATE_STATE.isEqualTo(StateType.Idle));
......@@ -30,7 +30,7 @@ import { ShowCurrentReleaseNotesActionId, CheckForVSCodeUpdateActionId } from 'v
import { IHostService } from 'vs/workbench/services/host/browser/host';
import { IProductService } from 'vs/platform/product/common/productService';
const CONTEXT_UPDATE_STATE = new RawContextKey<string>('updateState', StateType.Uninitialized);
export const CONTEXT_UPDATE_STATE = new RawContextKey<string>('updateState', StateType.Idle);
let releaseNotesManager: ReleaseNotesManager | undefined = undefined;
......@@ -473,19 +473,19 @@ export class UpdateContribution extends Disposable implements IWorkbenchContribu
export class CheckForVSCodeUpdateAction extends Action {
static readonly ID = CheckForVSCodeUpdateActionId;
static LABEL = nls.localize('checkForVSCodeUpdate', "Check for VS Code Update");
static LABEL = nls.localize('checkForUpdates', "Check for Updates...");
constructor(
id: string,
label: string,
@IWorkbenchEnvironmentService private readonly environmentService: IWorkbenchEnvironmentService,
@IWorkbenchEnvironmentService private readonly workbenchEnvironmentService: IWorkbenchEnvironmentService,
@IUpdateService private readonly updateService: IUpdateService,
) {
super(id, label, undefined, true);
}
run(): Promise<void> {
return this.updateService.checkForUpdates({ windowId: this.environmentService.configuration.windowId });
return this.updateService.checkForUpdates(this.workbenchEnvironmentService.configuration.sessionId);
}
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册