mirror of
https://github.com/microsoft/vscode.git
synced 2026-07-18 18:03:19 +01:00
add trace logging to know what keybinding triggers what command, fyi @alexdima
This commit is contained in:
@@ -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 = [];
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user