diff --git a/src/vs/editor/common/editorCommonExtensions.ts b/src/vs/editor/common/editorCommonExtensions.ts index a2dae07324b..7a0831137c5 100644 --- a/src/vs/editor/common/editorCommonExtensions.ts +++ b/src/vs/editor/common/editorCommonExtensions.ts @@ -87,8 +87,8 @@ export abstract class HandlerEditorAction extends EditorAction { // --- Editor Actions -export function editorAction(constructor:{ new(): EditorAction; }): void { - CommonEditorRegistry.registerEditorAction(new constructor()); +export function editorAction(ctor:{ new(): EditorAction; }): void { + CommonEditorRegistry.registerEditorAction(new ctor()); } export module CommonEditorRegistry { @@ -117,7 +117,7 @@ export module CommonEditorRegistry { return KeybindingsRegistry.WEIGHT.editorContrib(importance); } - export function registerEditorCommand2(desc: ConfigBasicCommand): void { + export function registerEditorCommand(desc: ConfigBasicCommand): void { KeybindingsRegistry.registerCommandAndKeybindingRule(desc.toCommandAndKeybindingRule(KeybindingsRegistry.WEIGHT.editorContrib())); } diff --git a/src/vs/editor/contrib/accessibility/browser/accessibility.ts b/src/vs/editor/contrib/accessibility/browser/accessibility.ts index 369a9a869a4..cb92413a3c9 100644 --- a/src/vs/editor/contrib/accessibility/browser/accessibility.ts +++ b/src/vs/editor/contrib/accessibility/browser/accessibility.ts @@ -215,7 +215,7 @@ EditorBrowserRegistry.registerEditorContribution(AccessibilityHelpController); const AccessibilityHelpCommand = EditorCommand.bindToContribution(AccessibilityHelpController.get); -CommonEditorRegistry.registerEditorCommand2(new AccessibilityHelpCommand({ +CommonEditorRegistry.registerEditorCommand(new AccessibilityHelpCommand({ id: 'closeAccessibilityHelp', precondition: CONTEXT_ACCESSIBILITY_WIDGET_VISIBLE, handler: x => x.hide(), @@ -245,4 +245,4 @@ class ToggleExperimentalScreenReaderSupportCommand extends Command { } } -CommonEditorRegistry.registerEditorCommand2(new ToggleExperimentalScreenReaderSupportCommand()); +CommonEditorRegistry.registerEditorCommand(new ToggleExperimentalScreenReaderSupportCommand()); diff --git a/src/vs/editor/contrib/find/common/findController.ts b/src/vs/editor/contrib/find/common/findController.ts index 0223616c6f7..a654239c9e8 100644 --- a/src/vs/editor/contrib/find/common/findController.ts +++ b/src/vs/editor/contrib/find/common/findController.ts @@ -848,7 +848,7 @@ export class SelectionHighlighter extends Disposable implements editorCommon.IEd const FindCommand = EditorCommand.bindToContribution(CommonFindController.getFindController); -CommonEditorRegistry.registerEditorCommand2(new FindCommand({ +CommonEditorRegistry.registerEditorCommand(new FindCommand({ id: FIND_IDS.CloseFindWidgetCommand, precondition: CONTEXT_FIND_WIDGET_VISIBLE, handler: x => x.closeFindWidget(), @@ -860,7 +860,7 @@ CommonEditorRegistry.registerEditorCommand2(new FindCommand({ } })); -CommonEditorRegistry.registerEditorCommand2(new FindCommand({ +CommonEditorRegistry.registerEditorCommand(new FindCommand({ id: FIND_IDS.ToggleCaseSensitiveCommand, precondition: null, handler: x => x.toggleCaseSensitive(), @@ -872,7 +872,7 @@ CommonEditorRegistry.registerEditorCommand2(new FindCommand({ } })); -CommonEditorRegistry.registerEditorCommand2(new FindCommand({ +CommonEditorRegistry.registerEditorCommand(new FindCommand({ id: FIND_IDS.ToggleWholeWordCommand, precondition: null, handler: x => x.toggleWholeWords(), @@ -884,7 +884,7 @@ CommonEditorRegistry.registerEditorCommand2(new FindCommand({ } })); -CommonEditorRegistry.registerEditorCommand2(new FindCommand({ +CommonEditorRegistry.registerEditorCommand(new FindCommand({ id: FIND_IDS.ToggleRegexCommand, precondition: null, handler: x => x.toggleRegex(), @@ -896,7 +896,7 @@ CommonEditorRegistry.registerEditorCommand2(new FindCommand({ } })); -CommonEditorRegistry.registerEditorCommand2(new FindCommand({ +CommonEditorRegistry.registerEditorCommand(new FindCommand({ id: FIND_IDS.ReplaceOneAction, precondition: CONTEXT_FIND_WIDGET_VISIBLE, handler: x => x.replace(), @@ -907,7 +907,7 @@ CommonEditorRegistry.registerEditorCommand2(new FindCommand({ } })); -CommonEditorRegistry.registerEditorCommand2(new FindCommand({ +CommonEditorRegistry.registerEditorCommand(new FindCommand({ id: FIND_IDS.ReplaceAllAction, precondition: CONTEXT_FIND_WIDGET_VISIBLE, handler: x => x.replaceAll(), @@ -918,7 +918,7 @@ CommonEditorRegistry.registerEditorCommand2(new FindCommand({ } })); -CommonEditorRegistry.registerEditorCommand2(new FindCommand({ +CommonEditorRegistry.registerEditorCommand(new FindCommand({ id: FIND_IDS.SelectAllMatchesAction, precondition: CONTEXT_FIND_WIDGET_VISIBLE, handler: x => x.selectAllMatches(), diff --git a/src/vs/editor/contrib/gotoError/browser/gotoError.ts b/src/vs/editor/contrib/gotoError/browser/gotoError.ts index 681db22853e..ccb41e1ecb1 100644 --- a/src/vs/editor/contrib/gotoError/browser/gotoError.ts +++ b/src/vs/editor/contrib/gotoError/browser/gotoError.ts @@ -548,7 +548,7 @@ var CONTEXT_MARKERS_NAVIGATION_VISIBLE = new KbCtxKey('markersNavigatio const MarkerCommand = EditorCommand.bindToContribution(MarkerController.getMarkerController); -CommonEditorRegistry.registerEditorCommand2(new MarkerCommand({ +CommonEditorRegistry.registerEditorCommand(new MarkerCommand({ id: 'closeMarkersNavigation', precondition: CONTEXT_MARKERS_NAVIGATION_VISIBLE, handler: x => x.closeMarkersNavigation(), diff --git a/src/vs/editor/contrib/parameterHints/browser/parameterHints.ts b/src/vs/editor/contrib/parameterHints/browser/parameterHints.ts index 9df7851e2de..1c352b0e6c8 100644 --- a/src/vs/editor/contrib/parameterHints/browser/parameterHints.ts +++ b/src/vs/editor/contrib/parameterHints/browser/parameterHints.ts @@ -84,7 +84,7 @@ const ParameterHintsCommand = EditorCommand.bindToContribution x.cancel(), @@ -95,7 +95,7 @@ CommonEditorRegistry.registerEditorCommand2(new ParameterHintsCommand({ secondary: [KeyMod.Shift | KeyCode.Escape] } })); -CommonEditorRegistry.registerEditorCommand2(new ParameterHintsCommand({ +CommonEditorRegistry.registerEditorCommand(new ParameterHintsCommand({ id: 'showPrevParameterHint', precondition: KbExpr.and(Context.Visible, Context.MultipleSignatures), handler: x => x.previous(), @@ -107,7 +107,7 @@ CommonEditorRegistry.registerEditorCommand2(new ParameterHintsCommand({ mac: { primary: KeyCode.UpArrow, secondary: [KeyMod.Alt | KeyCode.UpArrow, KeyMod.WinCtrl | KeyCode.KEY_P] } } })); -CommonEditorRegistry.registerEditorCommand2(new ParameterHintsCommand({ +CommonEditorRegistry.registerEditorCommand(new ParameterHintsCommand({ id: 'showNextParameterHint', precondition: KbExpr.and(Context.Visible, Context.MultipleSignatures), handler: x => x.next(), diff --git a/src/vs/editor/contrib/quickFix/browser/quickFix.ts b/src/vs/editor/contrib/quickFix/browser/quickFix.ts index 3ddee87412c..e7b760b25c7 100644 --- a/src/vs/editor/contrib/quickFix/browser/quickFix.ts +++ b/src/vs/editor/contrib/quickFix/browser/quickFix.ts @@ -140,7 +140,7 @@ var CONTEXT_QUICK_FIX_WIDGET_VISIBLE = new KbCtxKey('quickFixWidgetVisi const QuickFixCommand = EditorCommand.bindToContribution(QuickFixController.getQuickFixController); // register action -CommonEditorRegistry.registerEditorCommand2(new QuickFixCommand({ +CommonEditorRegistry.registerEditorCommand(new QuickFixCommand({ id: 'acceptQuickFixSuggestion', precondition: CONTEXT_QUICK_FIX_WIDGET_VISIBLE, handler: x => x.acceptSelectedSuggestion(), @@ -151,7 +151,7 @@ CommonEditorRegistry.registerEditorCommand2(new QuickFixCommand({ secondary: [KeyCode.Tab] } })); -CommonEditorRegistry.registerEditorCommand2(new QuickFixCommand({ +CommonEditorRegistry.registerEditorCommand(new QuickFixCommand({ id: 'closeQuickFixWidget', precondition: CONTEXT_QUICK_FIX_WIDGET_VISIBLE, handler: x => x.closeWidget(), @@ -162,7 +162,7 @@ CommonEditorRegistry.registerEditorCommand2(new QuickFixCommand({ secondary: [KeyMod.Shift | KeyCode.Escape] } })); -CommonEditorRegistry.registerEditorCommand2(new QuickFixCommand({ +CommonEditorRegistry.registerEditorCommand(new QuickFixCommand({ id: 'selectNextQuickFix', precondition: CONTEXT_QUICK_FIX_WIDGET_VISIBLE, handler: x => x.selectNextSuggestion(), @@ -173,7 +173,7 @@ CommonEditorRegistry.registerEditorCommand2(new QuickFixCommand({ mac: { primary: KeyCode.DownArrow, secondary: [KeyMod.WinCtrl | KeyCode.KEY_N] } } })); -CommonEditorRegistry.registerEditorCommand2(new QuickFixCommand({ +CommonEditorRegistry.registerEditorCommand(new QuickFixCommand({ id: 'selectNextPageQuickFix', precondition: CONTEXT_QUICK_FIX_WIDGET_VISIBLE, handler: x => x.selectNextPageSuggestion(), @@ -183,7 +183,7 @@ CommonEditorRegistry.registerEditorCommand2(new QuickFixCommand({ primary: KeyCode.PageDown } })); -CommonEditorRegistry.registerEditorCommand2(new QuickFixCommand({ +CommonEditorRegistry.registerEditorCommand(new QuickFixCommand({ id: 'selectPrevQuickFix', precondition: CONTEXT_QUICK_FIX_WIDGET_VISIBLE, handler: x => x.selectPrevSuggestion(), @@ -194,7 +194,7 @@ CommonEditorRegistry.registerEditorCommand2(new QuickFixCommand({ mac: { primary: KeyCode.UpArrow, secondary: [KeyMod.WinCtrl | KeyCode.KEY_P] } } })); -CommonEditorRegistry.registerEditorCommand2(new QuickFixCommand({ +CommonEditorRegistry.registerEditorCommand(new QuickFixCommand({ id: 'selectPrevPageQuickFix', precondition: CONTEXT_QUICK_FIX_WIDGET_VISIBLE, handler: x => x.selectPrevPageSuggestion(), diff --git a/src/vs/editor/contrib/rename/browser/rename.ts b/src/vs/editor/contrib/rename/browser/rename.ts index ba5c275f987..d8b10997c9c 100644 --- a/src/vs/editor/contrib/rename/browser/rename.ts +++ b/src/vs/editor/contrib/rename/browser/rename.ts @@ -174,7 +174,7 @@ EditorBrowserRegistry.registerEditorContribution(RenameController); const RenameCommand = EditorCommand.bindToContribution(RenameController.get); -CommonEditorRegistry.registerEditorCommand2(new RenameCommand({ +CommonEditorRegistry.registerEditorCommand(new RenameCommand({ id: 'acceptRenameInput', precondition: CONTEXT_RENAME_INPUT_VISIBLE, handler: x => x.acceptRenameInput(), @@ -185,7 +185,7 @@ CommonEditorRegistry.registerEditorCommand2(new RenameCommand({ } })); -CommonEditorRegistry.registerEditorCommand2(new RenameCommand({ +CommonEditorRegistry.registerEditorCommand(new RenameCommand({ id: 'cancelRenameInput', precondition: CONTEXT_RENAME_INPUT_VISIBLE, handler: x => x.cancelRenameInput(), diff --git a/src/vs/editor/contrib/snippet/common/snippet.ts b/src/vs/editor/contrib/snippet/common/snippet.ts index 8301a44e2ad..e2185c70767 100644 --- a/src/vs/editor/contrib/snippet/common/snippet.ts +++ b/src/vs/editor/contrib/snippet/common/snippet.ts @@ -944,7 +944,7 @@ export var CONTEXT_SNIPPET_MODE = new KbCtxKey('inSnippetMode', false); const SnippetCommand = EditorCommand.bindToContribution(SnippetController.get); CommonEditorRegistry.registerEditorContribution(SnippetController); -CommonEditorRegistry.registerEditorCommand2(new SnippetCommand({ +CommonEditorRegistry.registerEditorCommand(new SnippetCommand({ id: 'jumpToNextSnippetPlaceholder', precondition: CONTEXT_SNIPPET_MODE, handler: x => x.jumpToNextPlaceholder(), @@ -954,7 +954,7 @@ CommonEditorRegistry.registerEditorCommand2(new SnippetCommand({ primary: KeyCode.Tab } })); -CommonEditorRegistry.registerEditorCommand2(new SnippetCommand({ +CommonEditorRegistry.registerEditorCommand(new SnippetCommand({ id: 'jumpToPrevSnippetPlaceholder', precondition: CONTEXT_SNIPPET_MODE, handler: x => x.jumpToPrevPlaceholder(), @@ -964,7 +964,7 @@ CommonEditorRegistry.registerEditorCommand2(new SnippetCommand({ primary: KeyMod.Shift | KeyCode.Tab } })); -CommonEditorRegistry.registerEditorCommand2(new SnippetCommand({ +CommonEditorRegistry.registerEditorCommand(new SnippetCommand({ id: 'acceptSnippet', precondition: CONTEXT_SNIPPET_MODE, handler: x => x.acceptSnippet(), @@ -974,7 +974,7 @@ CommonEditorRegistry.registerEditorCommand2(new SnippetCommand({ primary: KeyCode.Enter } })); -CommonEditorRegistry.registerEditorCommand2(new SnippetCommand({ +CommonEditorRegistry.registerEditorCommand(new SnippetCommand({ id: 'leaveSnippet', precondition: CONTEXT_SNIPPET_MODE, handler: x => x.leaveSnippet(), diff --git a/src/vs/editor/contrib/suggest/browser/suggest.ts b/src/vs/editor/contrib/suggest/browser/suggest.ts index f19c945f63f..53f964d0114 100644 --- a/src/vs/editor/contrib/suggest/browser/suggest.ts +++ b/src/vs/editor/contrib/suggest/browser/suggest.ts @@ -206,7 +206,7 @@ const weight = CommonEditorRegistry.commandWeight(90); const SuggestCommand = EditorCommand.bindToContribution(SuggestController.getController); -CommonEditorRegistry.registerEditorCommand2(new SuggestCommand({ +CommonEditorRegistry.registerEditorCommand(new SuggestCommand({ id: 'acceptSelectedSuggestion', precondition: SuggestContext.Visible, handler: x => x.acceptSelectedSuggestion(), @@ -217,7 +217,7 @@ CommonEditorRegistry.registerEditorCommand2(new SuggestCommand({ } })); -CommonEditorRegistry.registerEditorCommand2(new SuggestCommand({ +CommonEditorRegistry.registerEditorCommand(new SuggestCommand({ id: 'acceptSelectedSuggestionOnEnter', precondition: SuggestContext.Visible, handler: x => x.acceptSelectedSuggestion(), @@ -228,7 +228,7 @@ CommonEditorRegistry.registerEditorCommand2(new SuggestCommand({ } })); -CommonEditorRegistry.registerEditorCommand2(new SuggestCommand({ +CommonEditorRegistry.registerEditorCommand(new SuggestCommand({ id: 'hideSuggestWidget', precondition: SuggestContext.Visible, handler: x => x.cancelSuggestWidget(), @@ -240,7 +240,7 @@ CommonEditorRegistry.registerEditorCommand2(new SuggestCommand({ } })); -CommonEditorRegistry.registerEditorCommand2(new SuggestCommand({ +CommonEditorRegistry.registerEditorCommand(new SuggestCommand({ id: 'selectNextSuggestion', precondition: KbExpr.and(SuggestContext.Visible, SuggestContext.MultipleSuggestions), handler: c => c.selectNextSuggestion(), @@ -253,7 +253,7 @@ CommonEditorRegistry.registerEditorCommand2(new SuggestCommand({ } })); -CommonEditorRegistry.registerEditorCommand2(new SuggestCommand({ +CommonEditorRegistry.registerEditorCommand(new SuggestCommand({ id: 'selectNextPageSuggestion', precondition: KbExpr.and(SuggestContext.Visible, SuggestContext.MultipleSuggestions), handler: c => c.selectNextPageSuggestion(), @@ -265,7 +265,7 @@ CommonEditorRegistry.registerEditorCommand2(new SuggestCommand({ } })); -CommonEditorRegistry.registerEditorCommand2(new SuggestCommand({ +CommonEditorRegistry.registerEditorCommand(new SuggestCommand({ id: 'selectFirstSuggestion', precondition: KbExpr.and(SuggestContext.Visible, SuggestContext.MultipleSuggestions), handler: c => c.selectFirstSuggestion(), @@ -277,7 +277,7 @@ CommonEditorRegistry.registerEditorCommand2(new SuggestCommand({ } })); -CommonEditorRegistry.registerEditorCommand2(new SuggestCommand({ +CommonEditorRegistry.registerEditorCommand(new SuggestCommand({ id: 'selectPrevSuggestion', precondition: KbExpr.and(SuggestContext.Visible, SuggestContext.MultipleSuggestions), handler: c => c.selectPrevSuggestion(), @@ -290,7 +290,7 @@ CommonEditorRegistry.registerEditorCommand2(new SuggestCommand({ } })); -CommonEditorRegistry.registerEditorCommand2(new SuggestCommand({ +CommonEditorRegistry.registerEditorCommand(new SuggestCommand({ id: 'selectPrevPageSuggestion', precondition: KbExpr.and(SuggestContext.Visible, SuggestContext.MultipleSuggestions), handler: c => c.selectPrevPageSuggestion(), @@ -302,7 +302,7 @@ CommonEditorRegistry.registerEditorCommand2(new SuggestCommand({ } })); -CommonEditorRegistry.registerEditorCommand2(new SuggestCommand({ +CommonEditorRegistry.registerEditorCommand(new SuggestCommand({ id: 'selectLastSuggestion', precondition: KbExpr.and(SuggestContext.Visible, SuggestContext.MultipleSuggestions), handler: c => c.selectLastSuggestion(), @@ -314,7 +314,7 @@ CommonEditorRegistry.registerEditorCommand2(new SuggestCommand({ } })); -CommonEditorRegistry.registerEditorCommand2(new SuggestCommand({ +CommonEditorRegistry.registerEditorCommand(new SuggestCommand({ id: 'toggleSuggestionDetails', precondition: SuggestContext.Visible, handler: x => x.toggleSuggestionDetails(), diff --git a/src/vs/editor/contrib/suggest/browser/tabCompletion.ts b/src/vs/editor/contrib/suggest/browser/tabCompletion.ts index b0413e84ce9..2a1a2e0aecd 100644 --- a/src/vs/editor/contrib/suggest/browser/tabCompletion.ts +++ b/src/vs/editor/contrib/suggest/browser/tabCompletion.ts @@ -81,7 +81,7 @@ CommonEditorRegistry.registerEditorContribution(TabCompletionController); const TabCompletionCommand = EditorCommand.bindToContribution(TabCompletionController.get); -CommonEditorRegistry.registerEditorCommand2(new TabCompletionCommand({ +CommonEditorRegistry.registerEditorCommand(new TabCompletionCommand({ id: 'insertSnippet', precondition: TabCompletionController.ContextKey, handler: x => x.performSnippetCompletions(), diff --git a/src/vs/workbench/parts/debug/browser/breakpointWidget.ts b/src/vs/workbench/parts/debug/browser/breakpointWidget.ts index 417d745cb9a..3bca0c85198 100644 --- a/src/vs/workbench/parts/debug/browser/breakpointWidget.ts +++ b/src/vs/workbench/parts/debug/browser/breakpointWidget.ts @@ -141,4 +141,4 @@ class CloseBreakpointWidgetCommand extends EditorCommand { } } } -CommonEditorRegistry.registerEditorCommand2(new CloseBreakpointWidgetCommand()); +CommonEditorRegistry.registerEditorCommand(new CloseBreakpointWidgetCommand());