diff --git a/src/vs/editor/standalone/browser/simpleServices.ts b/src/vs/editor/standalone/browser/simpleServices.ts index 01554deb137..b336adc20cb 100644 --- a/src/vs/editor/standalone/browser/simpleServices.ts +++ b/src/vs/editor/standalone/browser/simpleServices.ts @@ -46,6 +46,7 @@ import { SimpleServicesNLS } from 'vs/editor/common/standaloneStrings'; import { ClassifiedEvent, StrictPropertyCheck, GDPRClassification } from 'vs/platform/telemetry/common/gdprTypings'; import { basename } from 'vs/base/common/resources'; import { ICodeEditorService } from 'vs/editor/browser/services/codeEditorService'; +import { NullLogService } from 'vs/platform/log/common/log'; export class SimpleModel implements IResolvedTextEditorModel { @@ -292,7 +293,7 @@ export class StandaloneKeybindingService extends AbstractKeybindingService { notificationService: INotificationService, domNode: HTMLElement ) { - super(contextKeyService, commandService, telemetryService, notificationService); + super(contextKeyService, commandService, telemetryService, notificationService, new NullLogService()); this._cachedResolver = null; this._dynamicKeybindings = []; diff --git a/src/vs/platform/keybinding/common/abstractKeybindingService.ts b/src/vs/platform/keybinding/common/abstractKeybindingService.ts index 1fce530772a..c6e754997f1 100644 --- a/src/vs/platform/keybinding/common/abstractKeybindingService.ts +++ b/src/vs/platform/keybinding/common/abstractKeybindingService.ts @@ -17,6 +17,7 @@ import { ResolvedKeybindingItem } from 'vs/platform/keybinding/common/resolvedKe import { INotificationService } from 'vs/platform/notification/common/notification'; import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; import { WorkbenchActionExecutedEvent, WorkbenchActionExecutedClassification } from 'vs/base/common/actions'; +import { ILogService } from 'vs/platform/log/common/log'; interface CurrentChord { keypress: string; @@ -44,6 +45,7 @@ export abstract class AbstractKeybindingService extends Disposable implements IK protected _commandService: ICommandService, protected _telemetryService: ITelemetryService, private _notificationService: INotificationService, + protected _logService: ILogService, ) { super(); @@ -177,6 +179,8 @@ export abstract class AbstractKeybindingService extends Disposable implements IK const keypressLabel = keybinding.getLabel(); const resolveResult = this._getResolver().resolve(contextValue, currentChord, firstPart); + this._logService.trace('KeybindingService#dispatch', keypressLabel, resolveResult?.commandId); + if (resolveResult && resolveResult.enterChord) { shouldPreventDefault = true; this._enterChordMode(firstPart, keypressLabel); diff --git a/src/vs/platform/keybinding/test/common/abstractKeybindingService.test.ts b/src/vs/platform/keybinding/test/common/abstractKeybindingService.test.ts index 286ea8a57ae..5149a9202cc 100644 --- a/src/vs/platform/keybinding/test/common/abstractKeybindingService.test.ts +++ b/src/vs/platform/keybinding/test/common/abstractKeybindingService.test.ts @@ -16,6 +16,7 @@ import { USLayoutResolvedKeybinding } from 'vs/platform/keybinding/common/usLayo import { INotification, INotificationService, IPromptChoice, IPromptOptions, NoOpNotification, IStatusMessageOptions } from 'vs/platform/notification/common/notification'; import { NullTelemetryService } from 'vs/platform/telemetry/common/telemetryUtils'; import { Disposable } from 'vs/base/common/lifecycle'; +import { NullLogService } from 'vs/platform/log/common/log'; function createContext(ctx: any) { return { @@ -36,7 +37,7 @@ suite('AbstractKeybindingService', () => { commandService: ICommandService, notificationService: INotificationService ) { - super(contextKeyService, commandService, NullTelemetryService, notificationService); + super(contextKeyService, commandService, NullTelemetryService, notificationService, new NullLogService()); this._resolver = resolver; } diff --git a/src/vs/workbench/services/keybinding/browser/keybindingService.ts b/src/vs/workbench/services/keybinding/browser/keybindingService.ts index a9dc027018d..34ea342cc80 100644 --- a/src/vs/workbench/services/keybinding/browser/keybindingService.ts +++ b/src/vs/workbench/services/keybinding/browser/keybindingService.ts @@ -194,7 +194,7 @@ export class WorkbenchKeybindingService extends AbstractKeybindingService { @ILogService logService: ILogService, @IKeymapService private readonly keymapService: IKeymapService ) { - super(contextKeyService, commandService, telemetryService, notificationService); + super(contextKeyService, commandService, telemetryService, notificationService, logService); this.updateSchema();