Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
microsoft
GitHub Repository: microsoft/vscode
Path: blob/main/src/vs/workbench/contrib/emmet/browser/actions/expandAbbreviation.ts
3296 views
1
/*---------------------------------------------------------------------------------------------
2
* Copyright (c) Microsoft Corporation. All rights reserved.
3
* Licensed under the MIT License. See License.txt in the project root for license information.
4
*--------------------------------------------------------------------------------------------*/
5
import * as nls from '../../../../../nls.js';
6
import { EmmetEditorAction } from '../emmetActions.js';
7
import { registerEditorAction } from '../../../../../editor/browser/editorExtensions.js';
8
import { EditorContextKeys } from '../../../../../editor/common/editorContextKeys.js';
9
import { KeyCode } from '../../../../../base/common/keyCodes.js';
10
import { ContextKeyExpr } from '../../../../../platform/contextkey/common/contextkey.js';
11
import { KeybindingWeight } from '../../../../../platform/keybinding/common/keybindingsRegistry.js';
12
import { MenuId } from '../../../../../platform/actions/common/actions.js';
13
14
class ExpandAbbreviationAction extends EmmetEditorAction {
15
16
constructor() {
17
super({
18
id: 'editor.emmet.action.expandAbbreviation',
19
label: nls.localize2('expandAbbreviationAction', "Emmet: Expand Abbreviation"),
20
precondition: EditorContextKeys.writable,
21
actionName: 'expand_abbreviation',
22
kbOpts: {
23
primary: KeyCode.Tab,
24
kbExpr: ContextKeyExpr.and(
25
EditorContextKeys.editorTextFocus,
26
EditorContextKeys.tabDoesNotMoveFocus,
27
ContextKeyExpr.has('config.emmet.triggerExpansionOnTab')
28
),
29
weight: KeybindingWeight.EditorContrib
30
},
31
menuOpts: {
32
menuId: MenuId.MenubarEditMenu,
33
group: '5_insert',
34
title: nls.localize({ key: 'miEmmetExpandAbbreviation', comment: ['&& denotes a mnemonic'] }, "Emmet: E&&xpand Abbreviation"),
35
order: 3
36
}
37
});
38
39
}
40
}
41
42
registerEditorAction(ExpandAbbreviationAction);
43
44