From bb3c3f0b6d4ecfa450e69fa497f662a0494ccd1b Mon Sep 17 00:00:00 2001 From: Alex Dima Date: Fri, 17 Mar 2017 13:05:55 +0100 Subject: [PATCH] Extract USLayoutResolvedKeybinding to its own file --- .../browser/standalone/simpleServices.ts | 3 +- .../common/abstractKeybindingService.ts | 153 +---------------- .../common/usLayoutResolvedKeybinding.ts | 158 ++++++++++++++++++ .../common/abstractKeybindingService.test.ts | 3 +- .../test/common/keybindingLabels.test.ts | 2 +- .../test/common/keybindingResolver.test.ts | 2 +- .../test/common/mockKeybindingService.ts | 2 +- .../browser/keybindingsEditorContribution.ts | 2 +- .../search/test/browser/searchActions.test.ts | 2 +- .../electron-browser/keybindingService.ts | 3 +- .../keybinding/test/keybindingIO.test.ts | 2 +- .../keybinding/test/keyboardMapper.test.ts | 2 +- 12 files changed, 172 insertions(+), 162 deletions(-) create mode 100644 src/vs/platform/keybinding/common/usLayoutResolvedKeybinding.ts diff --git a/src/vs/editor/browser/standalone/simpleServices.ts b/src/vs/editor/browser/standalone/simpleServices.ts index 5e190c8edf3..d38d5c3a745 100644 --- a/src/vs/editor/browser/standalone/simpleServices.ts +++ b/src/vs/editor/browser/standalone/simpleServices.ts @@ -11,7 +11,8 @@ import { TPromise } from 'vs/base/common/winjs.base'; import { IConfigurationService, IConfigurationServiceEvent, IConfigurationValue, getConfigurationValue, IConfigurationKeys } from 'vs/platform/configuration/common/configuration'; import { IEditor, IEditorInput, IEditorOptions, IEditorService, IResourceInput, Position } from 'vs/platform/editor/common/editor'; import { ICommandService, ICommand, ICommandEvent, ICommandHandler, CommandsRegistry } from 'vs/platform/commands/common/commands'; -import { USLayoutResolvedKeybinding, AbstractKeybindingService } from 'vs/platform/keybinding/common/abstractKeybindingService'; +import { AbstractKeybindingService } from 'vs/platform/keybinding/common/abstractKeybindingService'; +import { USLayoutResolvedKeybinding } from 'vs/platform/keybinding/common/usLayoutResolvedKeybinding'; import { KeybindingResolver } from 'vs/platform/keybinding/common/keybindingResolver'; import { IKeybindingEvent, IKeybindingItem, KeybindingSource } from 'vs/platform/keybinding/common/keybinding'; import { ContextKeyExpr, IContextKeyService } from 'vs/platform/contextkey/common/contextkey'; diff --git a/src/vs/platform/keybinding/common/abstractKeybindingService.ts b/src/vs/platform/keybinding/common/abstractKeybindingService.ts index f1cce8ff1ef..54f1abacf55 100644 --- a/src/vs/platform/keybinding/common/abstractKeybindingService.ts +++ b/src/vs/platform/keybinding/common/abstractKeybindingService.ts @@ -5,9 +5,7 @@ 'use strict'; import * as nls from 'vs/nls'; -import { IHTMLContentElement } from 'vs/base/common/htmlContent'; -import { ResolvedKeybinding, SimpleKeybinding, Keybinding, KeyCode, KeyCodeUtils, USER_SETTINGS } from 'vs/base/common/keyCodes'; -import { PrintableKeypress, UILabelProvider, AriaLabelProvider, ElectronAcceleratorLabelProvider, UserSettingsLabelProvider } from 'vs/platform/keybinding/common/keybindingLabels'; +import { ResolvedKeybinding, SimpleKeybinding, Keybinding } from 'vs/base/common/keyCodes'; import { IDisposable, dispose } from 'vs/base/common/lifecycle'; import Severity from 'vs/base/common/severity'; import { ICommandService } from 'vs/platform/commands/common/commands'; @@ -17,155 +15,6 @@ import { IContextKeyService, IContextKeyServiceTarget } from 'vs/platform/contex import { IStatusbarService } from 'vs/platform/statusbar/common/statusbar'; import { IMessageService } from 'vs/platform/message/common/message'; import Event, { Emitter } from 'vs/base/common/event'; -import { OperatingSystem } from 'vs/base/common/platform'; - -/** - * Do not instantiate. Use KeybindingService to get a ResolvedKeybinding seeded with information about the current kb layout. - */ -export class USLayoutResolvedKeybinding extends ResolvedKeybinding { - - private readonly _actual: Keybinding; - private readonly _os: OperatingSystem; - - constructor(actual: Keybinding, os: OperatingSystem) { - super(); - this._actual = actual; - this._os = os; - } - - private static _usKeyCodeToUILabel(keyCode: KeyCode, OS: OperatingSystem): string { - if (OS === OperatingSystem.Macintosh) { - switch (keyCode) { - case KeyCode.LeftArrow: - return '←'; - case KeyCode.UpArrow: - return '↑'; - case KeyCode.RightArrow: - return '→'; - case KeyCode.DownArrow: - return '↓'; - } - } - return KeyCodeUtils.toString(keyCode); - } - - private static _usKeyCodeToAriaLabel(keyCode: KeyCode, OS: OperatingSystem): string { - return KeyCodeUtils.toString(keyCode); - } - - public getLabel(): string { - const [firstPart, chordPart] = PrintableKeypress.fromKeybinding(this._actual, USLayoutResolvedKeybinding._usKeyCodeToUILabel, this._os); - return UILabelProvider.toLabel2(firstPart, chordPart, this._os); - } - - public getAriaLabel(): string { - const [firstPart, chordPart] = PrintableKeypress.fromKeybinding(this._actual, USLayoutResolvedKeybinding._usKeyCodeToAriaLabel, this._os); - return AriaLabelProvider.toLabel2(firstPart, chordPart, this._os); - } - - public getHTMLLabel(): IHTMLContentElement[] { - const [firstPart, chordPart] = PrintableKeypress.fromKeybinding(this._actual, USLayoutResolvedKeybinding._usKeyCodeToUILabel, this._os); - return UILabelProvider.toHTMLLabel2(firstPart, chordPart, this._os); - } - - private static _usKeyCodeToElectronAccelerator(keyCode: KeyCode, OS: OperatingSystem): string { - switch (keyCode) { - case KeyCode.UpArrow: - return 'Up'; - case KeyCode.DownArrow: - return 'Down'; - case KeyCode.LeftArrow: - return 'Left'; - case KeyCode.RightArrow: - return 'Right'; - } - - return KeyCodeUtils.toString(keyCode); - } - - public getElectronAccelerator(): string { - if (this._actual.isChord()) { - // Electron cannot handle chords - return null; - } - - let keyCode = this._actual.getKeyCode(); - if (keyCode >= KeyCode.NUMPAD_0 && keyCode <= KeyCode.NUMPAD_DIVIDE) { - // Electron cannot handle numpad keys - return null; - } - - const [firstPart, chordPart] = PrintableKeypress.fromKeybinding(this._actual, USLayoutResolvedKeybinding._usKeyCodeToElectronAccelerator, this._os); - return ElectronAcceleratorLabelProvider.toLabel2(firstPart, chordPart, this._os); - } - - private static _usKeyCodeToUserSettings(keyCode: KeyCode, OS: OperatingSystem): string { - return USER_SETTINGS.fromKeyCode(keyCode); - } - - public getUserSettingsLabel(): string { - const [firstPart, chordPart] = PrintableKeypress.fromKeybinding(this._actual, USLayoutResolvedKeybinding._usKeyCodeToUserSettings, this._os); - - let result = UserSettingsLabelProvider.toLabel2(firstPart, chordPart, this._os); - return result.toLowerCase(); - } - - public isChord(): boolean { - return this._actual.isChord(); - } - - public hasCtrlModifier(): boolean { - if (this._actual.isChord()) { - return false; - } - if (this._os === OperatingSystem.Macintosh) { - return this._actual.hasWinCtrl(); - } else { - return this._actual.hasCtrlCmd(); - } - } - - public hasShiftModifier(): boolean { - if (this._actual.isChord()) { - return false; - } - return this._actual.hasShift(); - } - - public hasAltModifier(): boolean { - if (this._actual.isChord()) { - return false; - } - return this._actual.hasAlt(); - } - - public hasMetaModifier(): boolean { - if (this._actual.isChord()) { - return false; - } - if (this._os === OperatingSystem.Macintosh) { - return this._actual.hasCtrlCmd(); - } else { - return this._actual.hasWinCtrl(); - } - } - - public getDispatchParts(): [string, string] { - let keypressFirstPart: string; - let keypressChordPart: string; - if (this._actual === null) { - keypressFirstPart = null; - keypressChordPart = null; - } else if (this._actual.isChord()) { - keypressFirstPart = this._actual.extractFirstPart().value.toString(); - keypressChordPart = this._actual.extractChordPart().value.toString(); - } else { - keypressFirstPart = this._actual.value.toString(); - keypressChordPart = null; - } - return [keypressFirstPart, keypressChordPart]; - } -} interface CurrentChord { keypress: string; diff --git a/src/vs/platform/keybinding/common/usLayoutResolvedKeybinding.ts b/src/vs/platform/keybinding/common/usLayoutResolvedKeybinding.ts new file mode 100644 index 00000000000..c6f7332b58e --- /dev/null +++ b/src/vs/platform/keybinding/common/usLayoutResolvedKeybinding.ts @@ -0,0 +1,158 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +'use strict'; + +import { IHTMLContentElement } from 'vs/base/common/htmlContent'; +import { ResolvedKeybinding, Keybinding, KeyCode, KeyCodeUtils, USER_SETTINGS } from 'vs/base/common/keyCodes'; +import { PrintableKeypress, UILabelProvider, AriaLabelProvider, ElectronAcceleratorLabelProvider, UserSettingsLabelProvider } from 'vs/platform/keybinding/common/keybindingLabels'; +import { OperatingSystem } from 'vs/base/common/platform'; + +/** + * Do not instantiate. Use KeybindingService to get a ResolvedKeybinding seeded with information about the current kb layout. + */ +export class USLayoutResolvedKeybinding extends ResolvedKeybinding { + + private readonly _actual: Keybinding; + private readonly _os: OperatingSystem; + + constructor(actual: Keybinding, os: OperatingSystem) { + super(); + this._actual = actual; + this._os = os; + } + + private static _usKeyCodeToUILabel(keyCode: KeyCode, OS: OperatingSystem): string { + if (OS === OperatingSystem.Macintosh) { + switch (keyCode) { + case KeyCode.LeftArrow: + return '←'; + case KeyCode.UpArrow: + return '↑'; + case KeyCode.RightArrow: + return '→'; + case KeyCode.DownArrow: + return '↓'; + } + } + return KeyCodeUtils.toString(keyCode); + } + + private static _usKeyCodeToAriaLabel(keyCode: KeyCode, OS: OperatingSystem): string { + return KeyCodeUtils.toString(keyCode); + } + + public getLabel(): string { + const [firstPart, chordPart] = PrintableKeypress.fromKeybinding(this._actual, USLayoutResolvedKeybinding._usKeyCodeToUILabel, this._os); + return UILabelProvider.toLabel2(firstPart, chordPart, this._os); + } + + public getAriaLabel(): string { + const [firstPart, chordPart] = PrintableKeypress.fromKeybinding(this._actual, USLayoutResolvedKeybinding._usKeyCodeToAriaLabel, this._os); + return AriaLabelProvider.toLabel2(firstPart, chordPart, this._os); + } + + public getHTMLLabel(): IHTMLContentElement[] { + const [firstPart, chordPart] = PrintableKeypress.fromKeybinding(this._actual, USLayoutResolvedKeybinding._usKeyCodeToUILabel, this._os); + return UILabelProvider.toHTMLLabel2(firstPart, chordPart, this._os); + } + + private static _usKeyCodeToElectronAccelerator(keyCode: KeyCode, OS: OperatingSystem): string { + switch (keyCode) { + case KeyCode.UpArrow: + return 'Up'; + case KeyCode.DownArrow: + return 'Down'; + case KeyCode.LeftArrow: + return 'Left'; + case KeyCode.RightArrow: + return 'Right'; + } + + return KeyCodeUtils.toString(keyCode); + } + + public getElectronAccelerator(): string { + if (this._actual.isChord()) { + // Electron cannot handle chords + return null; + } + + let keyCode = this._actual.getKeyCode(); + if (keyCode >= KeyCode.NUMPAD_0 && keyCode <= KeyCode.NUMPAD_DIVIDE) { + // Electron cannot handle numpad keys + return null; + } + + const [firstPart, chordPart] = PrintableKeypress.fromKeybinding(this._actual, USLayoutResolvedKeybinding._usKeyCodeToElectronAccelerator, this._os); + return ElectronAcceleratorLabelProvider.toLabel2(firstPart, chordPart, this._os); + } + + private static _usKeyCodeToUserSettings(keyCode: KeyCode, OS: OperatingSystem): string { + return USER_SETTINGS.fromKeyCode(keyCode); + } + + public getUserSettingsLabel(): string { + const [firstPart, chordPart] = PrintableKeypress.fromKeybinding(this._actual, USLayoutResolvedKeybinding._usKeyCodeToUserSettings, this._os); + + let result = UserSettingsLabelProvider.toLabel2(firstPart, chordPart, this._os); + return result.toLowerCase(); + } + + public isChord(): boolean { + return this._actual.isChord(); + } + + public hasCtrlModifier(): boolean { + if (this._actual.isChord()) { + return false; + } + if (this._os === OperatingSystem.Macintosh) { + return this._actual.hasWinCtrl(); + } else { + return this._actual.hasCtrlCmd(); + } + } + + public hasShiftModifier(): boolean { + if (this._actual.isChord()) { + return false; + } + return this._actual.hasShift(); + } + + public hasAltModifier(): boolean { + if (this._actual.isChord()) { + return false; + } + return this._actual.hasAlt(); + } + + public hasMetaModifier(): boolean { + if (this._actual.isChord()) { + return false; + } + if (this._os === OperatingSystem.Macintosh) { + return this._actual.hasCtrlCmd(); + } else { + return this._actual.hasWinCtrl(); + } + } + + public getDispatchParts(): [string, string] { + let keypressFirstPart: string; + let keypressChordPart: string; + if (this._actual === null) { + keypressFirstPart = null; + keypressChordPart = null; + } else if (this._actual.isChord()) { + keypressFirstPart = this._actual.extractFirstPart().value.toString(); + keypressChordPart = this._actual.extractChordPart().value.toString(); + } else { + keypressFirstPart = this._actual.value.toString(); + keypressChordPart = null; + } + return [keypressFirstPart, keypressChordPart]; + } +} diff --git a/src/vs/platform/keybinding/test/common/abstractKeybindingService.test.ts b/src/vs/platform/keybinding/test/common/abstractKeybindingService.test.ts index 568240a2209..65c6e3c24d3 100644 --- a/src/vs/platform/keybinding/test/common/abstractKeybindingService.test.ts +++ b/src/vs/platform/keybinding/test/common/abstractKeybindingService.test.ts @@ -6,7 +6,8 @@ import * as assert from 'assert'; import { ResolvedKeybinding, Keybinding, SimpleKeybinding, createKeybinding, KeyCode, KeyMod, KeyChord } from 'vs/base/common/keyCodes'; -import { USLayoutResolvedKeybinding, AbstractKeybindingService } from 'vs/platform/keybinding/common/abstractKeybindingService'; +import { AbstractKeybindingService } from 'vs/platform/keybinding/common/abstractKeybindingService'; +import { USLayoutResolvedKeybinding } from 'vs/platform/keybinding/common/usLayoutResolvedKeybinding'; import { IDisposable } from 'vs/base/common/lifecycle'; import Severity from 'vs/base/common/severity'; import { ICommandService } from 'vs/platform/commands/common/commands'; diff --git a/src/vs/platform/keybinding/test/common/keybindingLabels.test.ts b/src/vs/platform/keybinding/test/common/keybindingLabels.test.ts index 1b0cce255d1..52ef86a9675 100644 --- a/src/vs/platform/keybinding/test/common/keybindingLabels.test.ts +++ b/src/vs/platform/keybinding/test/common/keybindingLabels.test.ts @@ -7,7 +7,7 @@ import * as assert from 'assert'; import { createKeybinding, KeyCode, KeyMod, KeyChord } from 'vs/base/common/keyCodes'; import { IHTMLContentElement } from 'vs/base/common/htmlContent'; -import { USLayoutResolvedKeybinding } from 'vs/platform/keybinding/common/abstractKeybindingService'; +import { USLayoutResolvedKeybinding } from 'vs/platform/keybinding/common/usLayoutResolvedKeybinding'; import { OperatingSystem } from 'vs/base/common/platform'; suite('KeybindingLabels', () => { diff --git a/src/vs/platform/keybinding/test/common/keybindingResolver.test.ts b/src/vs/platform/keybinding/test/common/keybindingResolver.test.ts index fc7bb7c5caf..4f77db0c424 100644 --- a/src/vs/platform/keybinding/test/common/keybindingResolver.test.ts +++ b/src/vs/platform/keybinding/test/common/keybindingResolver.test.ts @@ -9,7 +9,7 @@ import { createKeybinding, SimpleKeybinding, KeyCode, KeyMod, KeyChord } from 'v import { KeybindingResolver } from 'vs/platform/keybinding/common/keybindingResolver'; import { ContextKeyAndExpr, ContextKeyExpr } from 'vs/platform/contextkey/common/contextkey'; import { ResolvedKeybindingItem } from 'vs/platform/keybinding/common/resolvedKeybindingItem'; -import { USLayoutResolvedKeybinding } from 'vs/platform/keybinding/common/abstractKeybindingService'; +import { USLayoutResolvedKeybinding } from 'vs/platform/keybinding/common/usLayoutResolvedKeybinding'; import { OS } from 'vs/base/common/platform'; suite('KeybindingResolver', () => { diff --git a/src/vs/platform/keybinding/test/common/mockKeybindingService.ts b/src/vs/platform/keybinding/test/common/mockKeybindingService.ts index f9364b0f456..2b122cea16f 100644 --- a/src/vs/platform/keybinding/test/common/mockKeybindingService.ts +++ b/src/vs/platform/keybinding/test/common/mockKeybindingService.ts @@ -9,7 +9,7 @@ import Event from 'vs/base/common/event'; import { IKeybindingService, IKeybindingEvent, IKeybindingItem2 } from 'vs/platform/keybinding/common/keybinding'; import { IContextKey, IContextKeyService, IContextKeyServiceTarget, ContextKeyExpr } from 'vs/platform/contextkey/common/contextkey'; import { IResolveResult } from 'vs/platform/keybinding/common/keybindingResolver'; -import { USLayoutResolvedKeybinding } from 'vs/platform/keybinding/common/abstractKeybindingService'; +import { USLayoutResolvedKeybinding } from 'vs/platform/keybinding/common/usLayoutResolvedKeybinding'; import { OS } from 'vs/base/common/platform'; class MockKeybindingContextKey implements IContextKey { diff --git a/src/vs/workbench/parts/preferences/browser/keybindingsEditorContribution.ts b/src/vs/workbench/parts/preferences/browser/keybindingsEditorContribution.ts index 1ea6e2b5bba..41fd71c0494 100644 --- a/src/vs/workbench/parts/preferences/browser/keybindingsEditorContribution.ts +++ b/src/vs/workbench/parts/preferences/browser/keybindingsEditorContribution.ts @@ -24,7 +24,7 @@ import { CodeSnippet } from 'vs/editor/contrib/snippet/common/snippet'; import { SnippetController } from 'vs/editor/contrib/snippet/common/snippetController'; import { SmartSnippetInserter } from 'vs/workbench/parts/preferences/common/smartSnippetInserter'; import { DefineKeybindingOverlayWidget } from 'vs/workbench/parts/preferences/browser/keybindingWidgets'; -import { USLayoutResolvedKeybinding } from 'vs/platform/keybinding/common/abstractKeybindingService'; +import { USLayoutResolvedKeybinding } from 'vs/platform/keybinding/common/usLayoutResolvedKeybinding'; import { OS } from 'vs/base/common/platform'; import EditorContextKeys = editorCommon.EditorContextKeys; diff --git a/src/vs/workbench/parts/search/test/browser/searchActions.test.ts b/src/vs/workbench/parts/search/test/browser/searchActions.test.ts index 8dc939d0710..c698ed4699e 100644 --- a/src/vs/workbench/parts/search/test/browser/searchActions.test.ts +++ b/src/vs/workbench/parts/search/test/browser/searchActions.test.ts @@ -17,7 +17,7 @@ import { ModelServiceImpl } from 'vs/editor/common/services/modelServiceImpl'; import { IModelService } from 'vs/editor/common/services/modelService'; import { Tree } from 'vs/base/parts/tree/browser/treeImpl'; import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding'; -import { USLayoutResolvedKeybinding } from 'vs/platform/keybinding/common/abstractKeybindingService'; +import { USLayoutResolvedKeybinding } from 'vs/platform/keybinding/common/usLayoutResolvedKeybinding'; import { OS } from 'vs/base/common/platform'; suite('Search Actions', () => { diff --git a/src/vs/workbench/services/keybinding/electron-browser/keybindingService.ts b/src/vs/workbench/services/keybinding/electron-browser/keybindingService.ts index 088475e0f32..c6d1bdd1c5c 100644 --- a/src/vs/workbench/services/keybinding/electron-browser/keybindingService.ts +++ b/src/vs/workbench/services/keybinding/electron-browser/keybindingService.ts @@ -13,7 +13,8 @@ import { OS, OperatingSystem } from 'vs/base/common/platform'; import { toDisposable } from 'vs/base/common/lifecycle'; import { ExtensionMessageCollector, ExtensionsRegistry } from 'vs/platform/extensions/common/extensionsRegistry'; import { Extensions, IJSONContributionRegistry } from 'vs/platform/jsonschemas/common/jsonContributionRegistry'; -import { AbstractKeybindingService, USLayoutResolvedKeybinding } from 'vs/platform/keybinding/common/abstractKeybindingService'; +import { AbstractKeybindingService } from 'vs/platform/keybinding/common/abstractKeybindingService'; +import { USLayoutResolvedKeybinding } from 'vs/platform/keybinding/common/usLayoutResolvedKeybinding'; import { IStatusbarService } from 'vs/platform/statusbar/common/statusbar'; import { KeybindingResolver } from 'vs/platform/keybinding/common/keybindingResolver'; import { isFalsyOrEmpty } from 'vs/base/common/arrays'; diff --git a/src/vs/workbench/services/keybinding/test/keybindingIO.test.ts b/src/vs/workbench/services/keybinding/test/keybindingIO.test.ts index b795727aa51..e36f0b39166 100644 --- a/src/vs/workbench/services/keybinding/test/keybindingIO.test.ts +++ b/src/vs/workbench/services/keybinding/test/keybindingIO.test.ts @@ -9,7 +9,7 @@ import { createKeybinding, KeyCode, KeyMod, KeyChord, KeyCodeUtils } from 'vs/ba import { KeybindingIO } from 'vs/workbench/services/keybinding/common/keybindingIO'; import { OS, OperatingSystem } from 'vs/base/common/platform'; import { IUserFriendlyKeybinding } from 'vs/platform/keybinding/common/keybinding'; -import { USLayoutResolvedKeybinding } from 'vs/platform/keybinding/common/abstractKeybindingService'; +import { USLayoutResolvedKeybinding } from 'vs/platform/keybinding/common/usLayoutResolvedKeybinding'; suite('keybindingIO', () => { test('getUserSettingsKeybindingRegex', () => { diff --git a/src/vs/workbench/services/keybinding/test/keyboardMapper.test.ts b/src/vs/workbench/services/keybinding/test/keyboardMapper.test.ts index 99a99dfd354..a63bc0eba59 100644 --- a/src/vs/workbench/services/keybinding/test/keyboardMapper.test.ts +++ b/src/vs/workbench/services/keybinding/test/keyboardMapper.test.ts @@ -10,7 +10,7 @@ import { KeyMod, KeyCode, SimpleKeybinding, createKeybinding, Keybinding } from import { KeyboardMapper, IKeyboardMapping } from 'vs/workbench/services/keybinding/common/keyboardMapper'; import { OperatingSystem } from 'vs/base/common/platform'; import { UserSettingsLabelProvider, PrintableKeypress } from 'vs/platform/keybinding/common/keybindingLabels'; -import { USLayoutResolvedKeybinding } from 'vs/platform/keybinding/common/abstractKeybindingService'; +import { USLayoutResolvedKeybinding } from 'vs/platform/keybinding/common/usLayoutResolvedKeybinding'; import { KeyboardEventCodeUtils } from 'vs/workbench/services/keybinding/common/keyboardEventCode'; import { IHTMLContentElement } from 'vs/base/common/htmlContent'; import { readFile, writeFile } from 'vs/base/node/pfs'; -- GitLab