提交 d7a466fc 编写于 作者: J Johannes Rieken

make keybinding service log workbenchAction-event

上级 015698ac
......@@ -317,10 +317,11 @@ export class StandaloneKeybindingService extends AbstractKeybindingService {
constructor(
contextKeyService: IContextKeyService,
commandService: ICommandService,
telemetryService: ITelemetryService,
messageService: IMessageService,
domNode: HTMLElement
) {
super(contextKeyService, commandService, messageService);
super(contextKeyService, commandService, telemetryService, messageService);
this._cachedResolver = null;
this._dynamicKeybindings = [];
......
......@@ -176,7 +176,7 @@ export class DynamicStandaloneServices extends Disposable {
let commandService = ensure(ICommandService, () => new StandaloneCommandService(this._instantiationService));
ensure(IKeybindingService, () => this._register(new StandaloneKeybindingService(contextKeyService, commandService, messageService, domElement)));
ensure(IKeybindingService, () => this._register(new StandaloneKeybindingService(contextKeyService, commandService, telemetryService, messageService, domElement)));
let contextViewService = ensure(IContextViewService, () => this._register(new ContextViewService(domElement, telemetryService, messageService)));
......
......@@ -16,6 +16,7 @@ import { IStatusbarService } from 'vs/platform/statusbar/common/statusbar';
import { IMessageService } from 'vs/platform/message/common/message';
import Event, { Emitter } from 'vs/base/common/event';
import { ResolvedKeybindingItem } from 'vs/platform/keybinding/common/resolvedKeybindingItem';
import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry';
interface CurrentChord {
keypress: string;
......@@ -32,13 +33,15 @@ export abstract class AbstractKeybindingService implements IKeybindingService {
protected _onDidUpdateKeybindings: Emitter<IKeybindingEvent>;
private _contextKeyService: IContextKeyService;
protected _commandService: ICommandService;
private _statusService: IStatusbarService;
private _messageService: IMessageService;
protected _commandService: ICommandService;
protected _telemetryService: ITelemetryService;
constructor(
contextKeyService: IContextKeyService,
commandService: ICommandService,
telemetryService: ITelemetryService,
messageService: IMessageService,
statusService?: IStatusbarService
) {
......@@ -161,6 +164,13 @@ export abstract class AbstractKeybindingService implements IKeybindingService {
this._commandService.executeCommand(resolveResult.commandId, resolveResult.commandArgs || {}).done(undefined, err => {
this._messageService.show(Severity.Warning, err);
});
/* __GDPR__
"workbenchActionExecuted" : {
"id" : { "classification": "SystemMetaData", "purpose": "FeatureInsight" },
"from": { "classification": "SystemMetaData", "purpose": "FeatureInsight" }
}
*/
this._telemetryService.publicLog('workbenchActionExecuted', { id: resolveResult.commandId, from: 'keybinding' });
}
return shouldPreventDefault;
......
......@@ -259,13 +259,13 @@ export class WorkbenchKeybindingService extends AbstractKeybindingService {
windowElement: Window,
@IContextKeyService contextKeyService: IContextKeyService,
@ICommandService commandService: ICommandService,
@ITelemetryService private telemetryService: ITelemetryService,
@ITelemetryService telemetryService: ITelemetryService,
@IMessageService messageService: IMessageService,
@IEnvironmentService environmentService: IEnvironmentService,
@IStatusbarService statusBarService: IStatusbarService,
@IConfigurationService configurationService: IConfigurationService
) {
super(contextKeyService, commandService, messageService, statusBarService);
super(contextKeyService, commandService, telemetryService, messageService, statusBarService);
let dispatchConfig = getDispatchConfig(configurationService);
configurationService.onDidUpdateConfiguration((e) => {
......@@ -415,7 +415,7 @@ export class WorkbenchKeybindingService extends AbstractKeybindingService {
"keyCount" : { "classification": "SystemMetaData", "purpose": "FeatureInsight" }
}
*/
this.telemetryService.publicLog('customKeybindingsChanged', {
this._telemetryService.publicLog('customKeybindingsChanged', {
keyCount: cnt
});
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册