From 6dfcd835c43b4a434e7455e0824cb7801da47412 Mon Sep 17 00:00:00 2001 From: Keming Liang Date: Mon, 24 Oct 2022 16:55:34 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=88=9B=E5=BB=BA=E5=B7=A5?= =?UTF-8?q?=E7=A8=8B=E6=8F=92=E4=BB=B6=E8=8F=9C=E5=8D=95=E6=A0=8F=E7=9A=84?= =?UTF-8?q?=E5=88=9D=E5=A7=8B=E5=8C=96=E7=9B=B8=E5=85=B3=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../browser/parts/titlebar/menubarControl.ts | 12 ++++++------ .../browser/extensionEnablementService.ts | 1 + 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/vs/workbench/browser/parts/titlebar/menubarControl.ts b/src/vs/workbench/browser/parts/titlebar/menubarControl.ts index ecc7c8dc..9e829b02 100644 --- a/src/vs/workbench/browser/parts/titlebar/menubarControl.ts +++ b/src/vs/workbench/browser/parts/titlebar/menubarControl.ts @@ -118,9 +118,9 @@ MenuRegistry.appendMenuItem(MenuId.MenubarMainMenu, { MenuRegistry.appendMenuItem(MenuId.MenubarMainMenu, { submenu: MenuId.MenubarProjectMenu, title: { - value: (platform.language == 'zh-cn' ? '项目' : 'Project'), + value: (platform.language === 'zh-cn' ? '项目' : 'Project'), original: 'Project', - mnemonicTitle: (platform.language == 'zh-cn' ? '项目' : 'Project') + mnemonicTitle: (platform.language === 'zh-cn' ? '项目' : 'Project') }, order: 10 }); @@ -222,14 +222,14 @@ export abstract class MenubarControl extends Disposable { isenable = false; } if (isenable) { - if (extension.identifier.id = "kylin.vscode-create-project") { + if (extension.identifier.id === "kylin.vscode-create-project") { console.log("kylin.vscode-create-project is enable " + extension.identifier.id); this.hasCreateProjectExternsion = true; this.setupMainMenu(); this.doUpdateMenubar(true); } } else { - if (extension.identifier.id = "kylin.vscode-create-project") { + if (extension.identifier.id === "kylin.vscode-create-project") { console.log("kylin.vscode-create-project is disable " + extension.identifier.id); this.hasCreateProjectExternsion = false; this.setupMainMenu(); @@ -253,8 +253,8 @@ export abstract class MenubarControl extends Disposable { const [, mainMenuActions] = this.mainMenu.getActions()[0]; for (const mainMenuAction of mainMenuActions) { if (mainMenuAction instanceof SubmenuItemAction && typeof mainMenuAction.item.title !== 'string') { - if (mainMenuAction.item.title.original == "Project") { - if (this.hasCreateProjectExternsion == false) { + if (mainMenuAction.item.title.original === "Project") { + if (this.hasCreateProjectExternsion === false) { break; } } diff --git a/src/vs/workbench/services/extensionManagement/browser/extensionEnablementService.ts b/src/vs/workbench/services/extensionManagement/browser/extensionEnablementService.ts index 1040b35b..77459072 100644 --- a/src/vs/workbench/services/extensionManagement/browser/extensionEnablementService.ts +++ b/src/vs/workbench/services/extensionManagement/browser/extensionEnablementService.ts @@ -74,6 +74,7 @@ export class ExtensionEnablementService extends Disposable implements IWorkbench this._register(this.extensionsManager.onDidChangeExtensions(({ added, removed }) => this._onDidChangeExtensions(added, removed))); uninstallDisposable.dispose(); } + this._onEnablementChanged.fire(this.extensionsManager.extensions); }); this._register(this.globalExtensionEnablementService.onDidChangeEnablement(({ extensions, source }) => this._onDidChangeGloballyDisabledExtensions(extensions, source)));