未验证 提交 7396cb19 编写于 作者: A Alex Dima

Have the Toggle Keyboard Shortcuts Troubleshooting action open the renderer log

上级 e952b9cf
......@@ -94,6 +94,10 @@
"name": "vs/workbench/contrib/issue",
"project": "vscode-workbench"
},
{
"name": "vs/workbench/contrib/keybindings",
"project": "vscode-workbench"
},
{
"name": "vs/workbench/contrib/markers",
"project": "vscode-workbench"
......
/*---------------------------------------------------------------------------------------------
* 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 { rendererLogChannelId } from 'vs/workbench/contrib/logs/common/logConstants';
import { IOutputService } from 'vs/workbench/contrib/output/common/output';
const developerCategory = { value: nls.localize({ key: 'developer', comment: ['A developer on Code itself or someone diagnosing issues in Code'] }, "Developer"), original: 'Developer' };
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: developerCategory,
f1: true
});
}
run(accessor: ServicesAccessor): void {
const logging = accessor.get(IKeybindingService).toggleLogging();
if (logging) {
const outputService = accessor.get(IOutputService);
outputService.showChannel(rendererLogChannelId);
}
}
}
registerAction2(ToggleKeybindingsLogAction);
......@@ -31,7 +31,7 @@ import { IUserKeybindingItem, KeybindingIO, OutputBuilder } from 'vs/workbench/s
import { IKeyboardMapper } from 'vs/workbench/services/keybinding/common/keyboardMapper';
import { IHostService } from 'vs/workbench/services/host/browser/host';
import { IExtensionService } from 'vs/workbench/services/extensions/common/extensions';
import { Action2, MenuRegistry, registerAction2 } from 'vs/platform/actions/common/actions';
import { MenuRegistry } from 'vs/platform/actions/common/actions';
import { registerSingleton } from 'vs/platform/instantiation/common/extensions';
import { commandsExtensionPoint } from 'vs/workbench/api/common/menusExtensionPoint';
import { Disposable } from 'vs/base/common/lifecycle';
......@@ -48,7 +48,6 @@ import { ScanCode, ScanCodeUtils, IMMUTABLE_CODE_TO_KEY_CODE } from 'vs/base/com
import { flatten } from 'vs/base/common/arrays';
import { BrowserFeatures, KeyboardSupport } from 'vs/base/browser/canIUse';
import { ILogService } from 'vs/platform/log/common/log';
import { ServicesAccessor } from 'vs/platform/instantiation/common/instantiation';
import { ExtensionIdentifier } from 'vs/platform/extensions/common/extensions';
interface ContributedKeyBinding {
......@@ -745,26 +744,6 @@ let schema: IJSONSchema = {
}
};
const preferencesCategory = nls.localize('preferences', "Preferences");
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: preferencesCategory,
f1: true
});
}
run(accessor: ServicesAccessor): void {
accessor.get(IKeybindingService).toggleLogging();
}
}
registerAction2(ToggleKeybindingsLogAction);
let schemaRegistry = Registry.as<IJSONContributionRegistry>(Extensions.JSONContribution);
schemaRegistry.registerSchema(schemaId, schema);
......
......@@ -232,6 +232,9 @@ import 'vs/workbench/contrib/emmet/browser/emmet.contribution';
// CodeEditor Contributions
import 'vs/workbench/contrib/codeEditor/browser/codeEditor.contribution';
// Keybindings Contributions
import 'vs/workbench/contrib/keybindings/browser/keybindings.contribution';
// Execution
import 'vs/workbench/contrib/externalTerminal/browser/externalTerminal.contribution';
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册