提交 bf1db232 编写于 作者: B Benjamin Pasero

warn about workbench.action.terminal.focus

上级 dde41be0
...@@ -19,6 +19,8 @@ import {ResourceEditorInput} from 'vs/workbench/common/editor/resourceEditorInpu ...@@ -19,6 +19,8 @@ import {ResourceEditorInput} from 'vs/workbench/common/editor/resourceEditorInpu
import {IInstantiationService, ServicesAccessor} from 'vs/platform/instantiation/common/instantiation'; import {IInstantiationService, ServicesAccessor} from 'vs/platform/instantiation/common/instantiation';
import {KeybindingsRegistry} from 'vs/platform/keybinding/common/keybindingsRegistry'; import {KeybindingsRegistry} from 'vs/platform/keybinding/common/keybindingsRegistry';
import {KbExpr, IKeybindings} from 'vs/platform/keybinding/common/keybinding'; import {KbExpr, IKeybindings} from 'vs/platform/keybinding/common/keybinding';
import {ICommandService} from 'vs/platform/commands/common/commands';
import {IMessageService, Severity, CloseAction} from 'vs/platform/message/common/message';
import {TextCompareEditorVisible, TextDiffEditor} from 'vs/workbench/browser/parts/editor/textDiffEditor'; import {TextCompareEditorVisible, TextDiffEditor} from 'vs/workbench/browser/parts/editor/textDiffEditor';
import {IWorkbenchEditorService} from 'vs/workbench/services/editor/common/editorService'; import {IWorkbenchEditorService} from 'vs/workbench/services/editor/common/editorService';
import {BinaryResourceDiffEditor} from 'vs/workbench/browser/parts/editor/binaryDiffEditor'; import {BinaryResourceDiffEditor} from 'vs/workbench/browser/parts/editor/binaryDiffEditor';
...@@ -408,4 +410,34 @@ configurationRegistry.registerConfiguration({ ...@@ -408,4 +410,34 @@ configurationRegistry.registerConfiguration({
} }
}); });
registerEditorComamnds(); registerEditorComamnds();
\ No newline at end of file
const mapDeprecatedCommands = {
'workbench.action.terminal.focus': 'workbench.action.focusPanel'
};
Object.keys(mapDeprecatedCommands).forEach(deprecatedCommandId => {
const newCommandId = mapDeprecatedCommands[deprecatedCommandId];
KeybindingsRegistry.registerCommandAndKeybindingRule({
id: deprecatedCommandId,
weight: KeybindingsRegistry.WEIGHT.workbenchContrib(0),
handler(accessor: ServicesAccessor) {
const messageService = accessor.get(IMessageService);
const commandService = accessor.get(ICommandService);
messageService.show(Severity.Warning, {
message: nls.localize('commandDeprecated', "Command **{0}** has been removed. You can use **{1}** instead", deprecatedCommandId, newCommandId),
actions: [
CloseAction,
new Action('openKeybindings', nls.localize('openKeybindings', "Configure Keyboard Shortcuts"), null, true, () => {
return commandService.executeCommand('workbench.action.openGlobalKeybindings');
})
]
});
},
when: undefined,
primary: undefined
});
});
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册