strictNullChecks for macLinuxKeyboardMapper (#65426)

* strictNullChecks for macLinuxKeyboardMapper

* Fix strict null check for assertResolveUserBinding

* Add comma
pull/65941/head
Ashwin Ramaswami 2019-01-02 20:03:45 -05:00 committed by Matt Bierner
parent 3e7bb120c7
commit dfa7259c2d
3 changed files with 5 additions and 4 deletions

View File

@ -808,10 +808,11 @@
"./vs/workbench/services/title/common/titleService.ts",
"./vs/workbench/services/workspace/common/workspaceEditing.ts",
"./vs/workbench/test/common/editor/editorOptions.test.ts",
"./vs/workbench/services/keybinding/test/macLinuxKeyboardMapper.test.ts",
"./vs/workbench/test/common/notifications.test.ts",
"./vs/workbench/test/electron-browser/api/extHostTypes.test.ts",
"./vs/workbench/test/electron-browser/api/mock.ts"
],
],
"exclude": [
"./typings/require-monaco.d.ts"
]

View File

@ -34,8 +34,8 @@ function toIResolvedKeybinding(kb: ResolvedKeybinding): IResolvedKeybinding {
};
}
export function assertResolveKeybinding(mapper: IKeyboardMapper, keybinding: Keybinding, expected: IResolvedKeybinding[]): void {
let actual: IResolvedKeybinding[] = mapper.resolveKeybinding(keybinding).map(toIResolvedKeybinding);
export function assertResolveKeybinding(mapper: IKeyboardMapper, keybinding: Keybinding | null, expected: IResolvedKeybinding[]): void {
let actual: IResolvedKeybinding[] = mapper.resolveKeybinding(keybinding!).map(toIResolvedKeybinding);
assert.deepEqual(actual, expected);
}

View File

@ -1224,7 +1224,7 @@ suite('keyboardMapper', () => {
test('issue #24064: NumLock/NumPad keys stopped working in 1.11 on Linux', () => {
let mapper = new MacLinuxKeyboardMapper(false, {}, OperatingSystem.Linux);
function assertNumpadKeyboardEvent(keyCode: KeyCode, code: string, label: string, electronAccelerator: string, userSettingsLabel: string, dispatch: string): void {
function assertNumpadKeyboardEvent(keyCode: KeyCode, code: string, label: string, electronAccelerator: string | null, userSettingsLabel: string, dispatch: string): void {
assertResolveKeyboardEvent(
mapper,
{