From 33e7e030d2b9f40b3a822ced00991b88b38859a2 Mon Sep 17 00:00:00 2001 From: Raymond Zhao Date: Tue, 17 Nov 2020 23:15:00 +0000 Subject: [PATCH] Move Show Emmet Commands command to extension #58600 --- extensions/emmet/package.json | 5 +++ extensions/emmet/package.nls.json | 1 + extensions/emmet/src/emmetCommon.ts | 4 ++ .../browser/actions/showEmmetCommands.ts | 39 ------------------- .../emmet/browser/emmet.contribution.ts | 1 - 5 files changed, 10 insertions(+), 40 deletions(-) delete mode 100644 src/vs/workbench/contrib/emmet/browser/actions/showEmmetCommands.ts diff --git a/extensions/emmet/package.json b/extensions/emmet/package.json index 9898e0de97a..403d06f2cc7 100644 --- a/extensions/emmet/package.json +++ b/extensions/emmet/package.json @@ -342,6 +342,11 @@ "command": "editor.emmet.action.reflectCSSValue", "title": "%command.reflectCSSValue%", "category": "Emmet" + }, + { + "command": "editor.emmet.action.showEmmetCommands", + "title": "%command.showEmmetCommands%", + "category": "" } ], "menus": { diff --git a/extensions/emmet/package.nls.json b/extensions/emmet/package.nls.json index 3f3bf912fd8..2a1add8935e 100644 --- a/extensions/emmet/package.nls.json +++ b/extensions/emmet/package.nls.json @@ -23,6 +23,7 @@ "command.decrementNumberByOneTenth": "Decrement by 0.1", "command.incrementNumberByTen": "Increment by 10", "command.decrementNumberByTen": "Decrement by 10", + "command.showEmmetCommands": "Show Emmet Commands", "emmetSyntaxProfiles": "Define profile for specified syntax or use your own profile with specific rules.", "emmetExclude": "An array of languages where Emmet abbreviations should not be expanded.", "emmetExtensionsPath": "Path to a folder containing Emmet profiles and snippets.", diff --git a/extensions/emmet/src/emmetCommon.ts b/extensions/emmet/src/emmetCommon.ts index b508b2a9fc8..1fdae9889f7 100644 --- a/extensions/emmet/src/emmetCommon.ts +++ b/extensions/emmet/src/emmetCommon.ts @@ -124,6 +124,10 @@ export function activateEmmetExtension(context: vscode.ExtensionContext) { return reflectCssValue(); })); + context.subscriptions.push(vscode.commands.registerCommand('editor.emmet.action.showEmmetCommands', () => { + vscode.commands.executeCommand('workbench.action.quickOpen', '>Emmet: '); + })); + updateEmmetExtensionsPath(); context.subscriptions.push(vscode.workspace.onDidChangeConfiguration((e) => { diff --git a/src/vs/workbench/contrib/emmet/browser/actions/showEmmetCommands.ts b/src/vs/workbench/contrib/emmet/browser/actions/showEmmetCommands.ts deleted file mode 100644 index 1d931423323..00000000000 --- a/src/vs/workbench/contrib/emmet/browser/actions/showEmmetCommands.ts +++ /dev/null @@ -1,39 +0,0 @@ -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -import * as nls from 'vs/nls'; - -import { registerEditorAction, EditorAction, ServicesAccessor } from 'vs/editor/browser/editorExtensions'; -import { EditorContextKeys } from 'vs/editor/common/editorContextKeys'; -import { ICodeEditor } from 'vs/editor/browser/editorBrowser'; -import { MenuId } from 'vs/platform/actions/common/actions'; -import { IQuickInputService } from 'vs/platform/quickinput/common/quickInput'; - -const EMMET_COMMANDS_PREFIX = '>Emmet: '; - -class ShowEmmetCommandsAction extends EditorAction { - - constructor() { - super({ - id: 'workbench.action.showEmmetCommands', - label: nls.localize('showEmmetCommands', "Show Emmet Commands"), - alias: 'Show Emmet Commands', - precondition: EditorContextKeys.writable, - menuOpts: { - menuId: MenuId.MenubarEditMenu, - group: '5_insert', - title: nls.localize({ key: 'miShowEmmetCommands', comment: ['&& denotes a mnemonic'] }, "E&&mmet..."), - order: 4 - } - }); - } - - public async run(accessor: ServicesAccessor, editor: ICodeEditor): Promise { - const quickInputService = accessor.get(IQuickInputService); - quickInputService.quickAccess.show(EMMET_COMMANDS_PREFIX); - } -} - -registerEditorAction(ShowEmmetCommandsAction); diff --git a/src/vs/workbench/contrib/emmet/browser/emmet.contribution.ts b/src/vs/workbench/contrib/emmet/browser/emmet.contribution.ts index b603e987b29..f29d6b2c022 100644 --- a/src/vs/workbench/contrib/emmet/browser/emmet.contribution.ts +++ b/src/vs/workbench/contrib/emmet/browser/emmet.contribution.ts @@ -3,6 +3,5 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import './actions/showEmmetCommands'; import './actions/expandAbbreviation';