diff --git a/src/vs/platform/keybinding/common/abstractKeybindingService.ts b/src/vs/platform/keybinding/common/abstractKeybindingService.ts index d5b4edebad71e..f001258b68ed0 100644 --- a/src/vs/platform/keybinding/common/abstractKeybindingService.ts +++ b/src/vs/platform/keybinding/common/abstractKeybindingService.ts @@ -188,7 +188,7 @@ export abstract class AbstractKeybindingService extends Disposable implements IK if (!resolveResult.bubble) { shouldPreventDefault = true; } - this._commandService.executeCommand(resolveResult.commandId, resolveResult.commandArgs || {}).done(undefined, err => { + this._commandService.executeCommand(resolveResult.commandId, resolveResult.commandArgs).done(undefined, err => { this._notificationService.warn(err); }); /* __GDPR__ diff --git a/src/vs/platform/keybinding/common/keybindingsRegistry.ts b/src/vs/platform/keybinding/common/keybindingsRegistry.ts index 048ab78c86d23..39113558334d8 100644 --- a/src/vs/platform/keybinding/common/keybindingsRegistry.ts +++ b/src/vs/platform/keybinding/common/keybindingsRegistry.ts @@ -220,7 +220,7 @@ class KeybindingsRegistryImpl implements IKeybindingsRegistry { this._keybindings.push({ keybinding: keybinding, command: commandId, - commandArgs: null, + commandArgs: undefined, when: when, weight1: weight1, weight2: weight2 diff --git a/src/vs/platform/keybinding/test/common/abstractKeybindingService.test.ts b/src/vs/platform/keybinding/test/common/abstractKeybindingService.test.ts index 4de70895b8aba..2667368db09c0 100644 --- a/src/vs/platform/keybinding/test/common/abstractKeybindingService.test.ts +++ b/src/vs/platform/keybinding/test/common/abstractKeybindingService.test.ts @@ -234,7 +234,7 @@ suite('AbstractKeybindingService', () => { assert.equal(shouldPreventDefault, true); assert.deepEqual(executeCommandCalls, [{ commandId: 'simpleCommand', - args: [{}] + args: [null] }]); assert.deepEqual(showMessageCalls, []); assert.deepEqual(statusMessageCalls, []); @@ -303,7 +303,7 @@ suite('AbstractKeybindingService', () => { assert.equal(shouldPreventDefault, true); assert.deepEqual(executeCommandCalls, [{ commandId: 'simpleCommand', - args: [{}] + args: [null] }]); assert.deepEqual(showMessageCalls, []); assert.deepEqual(statusMessageCalls, []); @@ -334,7 +334,7 @@ suite('AbstractKeybindingService', () => { assert.equal(shouldPreventDefault, true); assert.deepEqual(executeCommandCalls, [{ commandId: 'chordCommand', - args: [{}] + args: [null] }]); assert.deepEqual(showMessageCalls, []); assert.deepEqual(statusMessageCalls, []); @@ -363,7 +363,7 @@ suite('AbstractKeybindingService', () => { assert.equal(shouldPreventDefault, true); assert.deepEqual(executeCommandCalls, [{ commandId: 'simpleCommand', - args: [{}] + args: [null] }]); assert.deepEqual(showMessageCalls, []); assert.deepEqual(statusMessageCalls, []); @@ -381,7 +381,7 @@ suite('AbstractKeybindingService', () => { assert.equal(shouldPreventDefault, true); assert.deepEqual(executeCommandCalls, [{ commandId: 'simpleCommand', - args: [{}] + args: [null] }]); assert.deepEqual(showMessageCalls, []); assert.deepEqual(statusMessageCalls, []); @@ -421,7 +421,7 @@ suite('AbstractKeybindingService', () => { assert.equal(shouldPreventDefault, false); assert.deepEqual(executeCommandCalls, [{ commandId: 'simpleCommand', - args: [{}] + args: [null] }]); assert.deepEqual(showMessageCalls, []); assert.deepEqual(statusMessageCalls, []); diff --git a/src/vs/workbench/services/keybinding/common/keybindingIO.ts b/src/vs/workbench/services/keybinding/common/keybindingIO.ts index 64037ac9774b3..13f82fbc817f1 100644 --- a/src/vs/workbench/services/keybinding/common/keybindingIO.ts +++ b/src/vs/workbench/services/keybinding/common/keybindingIO.ts @@ -42,7 +42,7 @@ export class KeybindingIO { const [firstPart, chordPart] = (typeof input.key === 'string' ? this._readUserBinding(input.key) : [null, null]); const when = (typeof input.when === 'string' ? ContextKeyExpr.deserialize(input.when) : null); const command = (typeof input.command === 'string' ? input.command : null); - const commandArgs = (typeof input.args !== 'undefined' ? input.args : null); + const commandArgs = (typeof input.args !== 'undefined' ? input.args : undefined); return { firstPart: firstPart, chordPart: chordPart,