Merge from vscode e3c4990c67c40213af168300d1cfeb71d680f877 (#16569)

This commit is contained in:
Cory Rivera
2021-08-25 16:28:29 -07:00
committed by GitHub
parent ab1112bfb3
commit cb7b7da0a4
1752 changed files with 59525 additions and 33878 deletions

View File

@@ -24,6 +24,9 @@ interface CurrentChord {
label: string | null;
}
// Skip logging for high-frequency text editing commands
const HIGH_FREQ_COMMANDS = /^(cursor|delete)/;
export abstract class AbstractKeybindingService extends Disposable implements IKeybindingService {
public _serviceBrand: undefined;
@@ -107,8 +110,8 @@ export abstract class AbstractKeybindingService extends Disposable implements IK
);
}
public lookupKeybinding(commandId: string): ResolvedKeybinding | undefined {
const result = this._getResolver().lookupPrimaryKeybinding(commandId);
public lookupKeybinding(commandId: string, context?: IContextKeyService): ResolvedKeybinding | undefined {
const result = this._getResolver().lookupPrimaryKeybinding(commandId, context);
if (!result) {
return undefined;
}
@@ -263,7 +266,9 @@ export abstract class AbstractKeybindingService extends Disposable implements IK
} else {
this._commandService.executeCommand(resolveResult.commandId, resolveResult.commandArgs).then(undefined, err => this._notificationService.warn(err));
}
this._telemetryService.publicLog2<WorkbenchActionExecutedEvent, WorkbenchActionExecutedClassification>('workbenchActionExecuted', { id: resolveResult.commandId, from: 'keybinding' });
if (!HIGH_FREQ_COMMANDS.test(resolveResult.commandId)) {
this._telemetryService.publicLog2<WorkbenchActionExecutedEvent, WorkbenchActionExecutedClassification>('workbenchActionExecuted', { id: resolveResult.commandId, from: 'keybinding' });
}
}
return shouldPreventDefault;