warn about workbench.action.terminal.focus

This commit is contained in:
Benjamin Pasero 2016-08-08 08:29:16 +02:00
parent dde41be023
commit bf1db232ca

View file

@ -19,6 +19,8 @@ import {ResourceEditorInput} from 'vs/workbench/common/editor/resourceEditorInpu
import {IInstantiationService, ServicesAccessor} from 'vs/platform/instantiation/common/instantiation';
import {KeybindingsRegistry} from 'vs/platform/keybinding/common/keybindingsRegistry';
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 {IWorkbenchEditorService} from 'vs/workbench/services/editor/common/editorService';
import {BinaryResourceDiffEditor} from 'vs/workbench/browser/parts/editor/binaryDiffEditor';
@ -408,4 +410,34 @@ configurationRegistry.registerConfiguration({
}
});
registerEditorComamnds();
registerEditorComamnds();
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
});
});