registerEditorCommand2 -> registerEditorCommand

This commit is contained in:
Alex Dima 2016-08-09 17:58:38 +02:00
parent 734b971c5b
commit dcf34da773
11 changed files with 40 additions and 40 deletions

View file

@ -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()));
}

View file

@ -215,7 +215,7 @@ EditorBrowserRegistry.registerEditorContribution(AccessibilityHelpController);
const AccessibilityHelpCommand = EditorCommand.bindToContribution<AccessibilityHelpController>(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());

View file

@ -848,7 +848,7 @@ export class SelectionHighlighter extends Disposable implements editorCommon.IEd
const FindCommand = EditorCommand.bindToContribution<CommonFindController>(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(),

View file

@ -548,7 +548,7 @@ var CONTEXT_MARKERS_NAVIGATION_VISIBLE = new KbCtxKey<boolean>('markersNavigatio
const MarkerCommand = EditorCommand.bindToContribution<MarkerController>(MarkerController.getMarkerController);
CommonEditorRegistry.registerEditorCommand2(new MarkerCommand({
CommonEditorRegistry.registerEditorCommand(new MarkerCommand({
id: 'closeMarkersNavigation',
precondition: CONTEXT_MARKERS_NAVIGATION_VISIBLE,
handler: x => x.closeMarkersNavigation(),

View file

@ -84,7 +84,7 @@ const ParameterHintsCommand = EditorCommand.bindToContribution<ParameterHintsCon
EditorBrowserRegistry.registerEditorContribution(ParameterHintsController);
CommonEditorRegistry.registerEditorCommand2(new ParameterHintsCommand({
CommonEditorRegistry.registerEditorCommand(new ParameterHintsCommand({
id: 'closeParameterHints',
precondition: Context.Visible,
handler: x => 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(),

View file

@ -140,7 +140,7 @@ var CONTEXT_QUICK_FIX_WIDGET_VISIBLE = new KbCtxKey<boolean>('quickFixWidgetVisi
const QuickFixCommand = EditorCommand.bindToContribution<QuickFixController>(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(),

View file

@ -174,7 +174,7 @@ EditorBrowserRegistry.registerEditorContribution(RenameController);
const RenameCommand = EditorCommand.bindToContribution<RenameController>(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(),

View file

@ -944,7 +944,7 @@ export var CONTEXT_SNIPPET_MODE = new KbCtxKey<boolean>('inSnippetMode', false);
const SnippetCommand = EditorCommand.bindToContribution<ISnippetController>(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(),

View file

@ -206,7 +206,7 @@ const weight = CommonEditorRegistry.commandWeight(90);
const SuggestCommand = EditorCommand.bindToContribution<SuggestController>(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(),

View file

@ -81,7 +81,7 @@ CommonEditorRegistry.registerEditorContribution(TabCompletionController);
const TabCompletionCommand = EditorCommand.bindToContribution<TabCompletionController>(TabCompletionController.get);
CommonEditorRegistry.registerEditorCommand2(new TabCompletionCommand({
CommonEditorRegistry.registerEditorCommand(new TabCompletionCommand({
id: 'insertSnippet',
precondition: TabCompletionController.ContextKey,
handler: x => x.performSnippetCompletions(),

View file

@ -141,4 +141,4 @@ class CloseBreakpointWidgetCommand extends EditorCommand {
}
}
}
CommonEditorRegistry.registerEditorCommand2(new CloseBreakpointWidgetCommand());
CommonEditorRegistry.registerEditorCommand(new CloseBreakpointWidgetCommand());