blob: 5f6cdfb32983976df670b0b41d401cde7da80450 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
|
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import * as nls from 'vs/nls';
import { Action2, registerAction2 } from 'vs/platform/actions/common/actions';
import { ServicesAccessor } from 'vs/platform/instantiation/common/instantiation';
import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding';
import { CATEGORIES } from 'vs/workbench/common/actions';
import { rendererLogChannelId } from 'vs/workbench/contrib/logs/common/logConstants';
import { IOutputService } from 'vs/workbench/services/output/common/output';
class ToggleKeybindingsLogAction extends Action2 {
constructor() {
super({
id: 'workbench.action.toggleKeybindingsLog',
title: { value: nls.localize('toggleKeybindingsLog', "Toggle Keyboard Shortcuts Troubleshooting"), original: 'Toggle Keyboard Shortcuts Troubleshooting' },
category: CATEGORIES.Developer,
f1: true
});
}
run(accessor: ServicesAccessor): void {
const logging = accessor.get(IKeybindingService).toggleLogging();
if (logging) {
const outputService = accessor.get(IOutputService);
outputService.showChannel(rendererLogChannelId);
}
}
}
registerAction2(ToggleKeybindingsLogAction);
|