EditorAction2 -> EditorAction

This commit is contained in:
Alex Dima 2016-08-04 15:36:59 +02:00
parent f64059d2f6
commit 5a9667938d
52 changed files with 214 additions and 232 deletions

View file

@ -7,7 +7,7 @@
import {TPromise} from 'vs/base/common/winjs.base';
import {IActionDescriptor, ICommonCodeEditor, IEditorAction} from 'vs/editor/common/editorCommon';
import {IInstantiationService} from 'vs/platform/instantiation/common/instantiation';
import {EditorAction2} from 'vs/editor/common/editorCommonExtensions';
import {EditorAction} from 'vs/editor/common/editorCommonExtensions';
export abstract class AbstractInternalEditorAction {
@ -25,10 +25,10 @@ export abstract class AbstractInternalEditorAction {
export class InternalEditorAction extends AbstractInternalEditorAction implements IEditorAction {
private _actual: EditorAction2;
private _actual: EditorAction;
private _instantiationService:IInstantiationService;
constructor(actual:EditorAction2, editor:ICommonCodeEditor, instantiationService:IInstantiationService) {
constructor(actual:EditorAction, editor:ICommonCodeEditor, instantiationService:IInstantiationService) {
super(actual.id, actual.label, actual.alias, editor);
this._actual = actual;
this._instantiationService = instantiationService;

View file

@ -6,7 +6,6 @@
import {illegalArgument, onUnexpectedError} from 'vs/base/common/errors';
import URI from 'vs/base/common/uri';
import {SyncDescriptor1, createSyncDescriptor} from 'vs/platform/instantiation/common/descriptors';
import {TPromise} from 'vs/base/common/winjs.base';
import {ServicesAccessor, IInstantiationService} from 'vs/platform/instantiation/common/instantiation';
import {IKeybindings, KbExpr} from 'vs/platform/keybinding/common/keybinding';
@ -38,20 +37,20 @@ export interface IEditorCommandHandler {
export module CommonEditorRegistry {
export function registerEditorAction2(desc:EditorAction2) {
(<EditorContributionRegistry>Registry.as(Extensions.EditorCommonContributions)).registerEditorAction2(desc);
export function registerEditorAction(desc:EditorAction) {
(<EditorContributionRegistry>Registry.as(Extensions.EditorCommonContributions)).registerEditorAction(desc);
}
export function getEditorActions(): EditorAction2[] {
return (<EditorContributionRegistry>Registry.as(Extensions.EditorCommonContributions)).getEditorActions2();
export function getEditorActions(): EditorAction[] {
return (<EditorContributionRegistry>Registry.as(Extensions.EditorCommonContributions)).getEditorActions();
}
// --- Editor Contributions
export function registerEditorContribution(ctor:editorCommon.ICommonEditorContributionCtor): void {
(<EditorContributionRegistry>Registry.as(Extensions.EditorCommonContributions)).registerEditorContribution2(ctor);
(<EditorContributionRegistry>Registry.as(Extensions.EditorCommonContributions)).registerEditorContribution(ctor);
}
export function getEditorContributions(): editorCommon.ICommonEditorContributionDescriptor[] {
return (<EditorContributionRegistry>Registry.as(Extensions.EditorCommonContributions)).getEditorContributions2();
return (<EditorContributionRegistry>Registry.as(Extensions.EditorCommonContributions)).getEditorContributions();
}
// --- Editor Commands
@ -119,23 +118,6 @@ class SimpleEditorContributionDescriptor implements editorCommon.ICommonEditorCo
}
}
class InternalEditorActionDescriptor implements editorCommon.ICommonEditorContributionDescriptor {
private _descriptor: SyncDescriptor1<editorCommon.ICommonCodeEditor, editorCommon.IEditorContribution>;
constructor(ctor:editorCommon.IEditorActionContributionCtor, id:string, label:string, alias:string) {
this._descriptor = createSyncDescriptor(ctor, {
id,
label,
alias
});
}
public createInstance(instService:IInstantiationService, editor:editorCommon.ICommonCodeEditor): editorCommon.IEditorContribution {
return instService.createInstance(this._descriptor, editor);
}
}
// Editor extension points
var Extensions = {
EditorCommonContributions: 'editor.commonContributions'
@ -144,18 +126,18 @@ var Extensions = {
class EditorContributionRegistry {
private editorContributions: editorCommon.ICommonEditorContributionDescriptor[];
private editorActions: EditorAction2[];
private editorActions: EditorAction[];
constructor() {
this.editorContributions = [];
this.editorActions = [];
}
public registerEditorContribution2(ctor:editorCommon.ICommonEditorContributionCtor): void {
public registerEditorContribution(ctor:editorCommon.ICommonEditorContributionCtor): void {
this.editorContributions.push(new SimpleEditorContributionDescriptor(ctor));
}
public registerEditorAction2(action:EditorAction2) {
public registerEditorAction(action:EditorAction) {
if (action.menuOpts) {
MenuRegistry.appendMenuItem(action.menuOpts.menu || MenuId.EditorContext, {
@ -192,11 +174,11 @@ class EditorContributionRegistry {
this.editorActions.push(action);
}
public getEditorContributions2(): editorCommon.ICommonEditorContributionDescriptor[] {
public getEditorContributions(): editorCommon.ICommonEditorContributionDescriptor[] {
return this.editorContributions.slice(0);
}
public getEditorActions2(): EditorAction2[] {
public getEditorActions(): EditorAction[] {
return this.editorActions.slice(0);
}
}
@ -245,7 +227,7 @@ export interface IEditorActionKeybindingOptions2 extends IKeybindings {
commandHandler?: ICommandHandler;
}
export abstract class EditorAction2 {
export abstract class EditorAction {
private _needsWritableEditor: boolean;
@ -281,7 +263,7 @@ export abstract class EditorAction2 {
public abstract run(accessor:ServicesAccessor, editor:editorCommon.ICommonCodeEditor): void | TPromise<void>;
}
export abstract class HandlerEditorAction2 extends EditorAction2 {
export abstract class HandlerEditorAction extends EditorAction {
private _handlerId: string;
constructor(id:string, label:string, alias:string, needsWritableEditor:boolean, handlerId: string) {

View file

@ -19,7 +19,7 @@ import {IKeybindingContextKey, IKeybindingService} from 'vs/platform/keybinding/
import {KeybindingsRegistry} from 'vs/platform/keybinding/common/keybindingsRegistry';
import {GlobalScreenReaderNVDA} from 'vs/editor/common/config/commonEditorConfig';
import {ICommonCodeEditor, IEditorContribution, SHOW_ACCESSIBILITY_HELP_ACTION_ID} from 'vs/editor/common/editorCommon';
import {CommonEditorRegistry, EditorKbExpr, EditorAction2} from 'vs/editor/common/editorCommonExtensions';
import {CommonEditorRegistry, EditorKbExpr, EditorAction} from 'vs/editor/common/editorCommonExtensions';
import {ICodeEditor, IOverlayWidget, IOverlayWidgetPosition} from 'vs/editor/browser/editorBrowser';
import {EditorBrowserRegistry} from 'vs/editor/browser/editorBrowserExtensions';
import {ToggleTabFocusModeAction} from 'vs/editor/contrib/toggleTabFocusMode/common/toggleTabFocusMode';
@ -189,7 +189,7 @@ class AccessibilityHelpWidget extends Widget implements IOverlayWidget {
}
}
class ShowAccessibilityHelpAction extends EditorAction2 {
class ShowAccessibilityHelpAction extends EditorAction {
constructor() {
super(
@ -212,7 +212,7 @@ class ShowAccessibilityHelpAction extends EditorAction2 {
}
EditorBrowserRegistry.registerEditorContribution(AccessibilityHelpController);
CommonEditorRegistry.registerEditorAction2(new ShowAccessibilityHelpAction());
CommonEditorRegistry.registerEditorAction(new ShowAccessibilityHelpAction());
CommonEditorRegistry.registerEditorCommand('closeAccessibilityHelp', CommonEditorRegistry.commandWeight(100), { primary: KeyCode.Escape, secondary: [KeyMod.Shift | KeyCode.Escape] }, false, CONTEXT_ACCESSIBILITY_WIDGET_VISIBLE, (ctx, editor, args) => {
AccessibilityHelpController.get(editor).hide();
});

View file

@ -6,10 +6,10 @@
import * as nls from 'vs/nls';
import {ICommand, ICommonCodeEditor} from 'vs/editor/common/editorCommon';
import {EditorAction2, CommonEditorRegistry, ServicesAccessor} from 'vs/editor/common/editorCommonExtensions';
import {EditorAction, CommonEditorRegistry, ServicesAccessor} from 'vs/editor/common/editorCommonExtensions';
import {MoveCarretCommand} from './moveCarretCommand';
class MoveCarretAction extends EditorAction2 {
class MoveCarretAction extends EditorAction {
private left:boolean;
@ -55,5 +55,5 @@ class MoveCarretRightAction extends MoveCarretAction {
}
}
CommonEditorRegistry.registerEditorAction2(new MoveCarretLeftAction());
CommonEditorRegistry.registerEditorAction2(new MoveCarretRightAction());
CommonEditorRegistry.registerEditorAction(new MoveCarretLeftAction());
CommonEditorRegistry.registerEditorAction(new MoveCarretRightAction());

View file

@ -13,12 +13,12 @@ import {ServicesAccessor} from 'vs/platform/instantiation/common/instantiation';
import {KbExpr} from 'vs/platform/keybinding/common/keybinding';
import {findFocusedEditor} from 'vs/editor/common/config/config';
import * as editorCommon from 'vs/editor/common/editorCommon';
import {EditorKbExpr, EditorAction2, CommonEditorRegistry} from 'vs/editor/common/editorCommonExtensions';
import {EditorKbExpr, EditorAction, CommonEditorRegistry} from 'vs/editor/common/editorCommonExtensions';
import {MenuId} from 'vs/platform/actions/common/actions';
const CLIPBOARD_CONTEXT_MENU_GROUP = '9_cutcopypaste';
abstract class ClipboardWritingAction extends EditorAction2 {
abstract class ClipboardWritingAction extends EditorAction {
constructor(id:string, label:string, alias:string, needsWritableEditor:boolean) {
super(id, label, alias, needsWritableEditor);
@ -120,7 +120,7 @@ class ExecCommandCopyAction extends ClipboardWritingAction {
}
}
class ExecCommandPasteAction extends EditorAction2 {
class ExecCommandPasteAction extends EditorAction {
constructor() {
super(
@ -159,13 +159,13 @@ class ExecCommandPasteAction extends EditorAction2 {
}
if (browser.supportsExecCommand('cut')) {
CommonEditorRegistry.registerEditorAction2(new ExecCommandCutAction());
CommonEditorRegistry.registerEditorAction(new ExecCommandCutAction());
}
if (browser.supportsExecCommand('copy')) {
CommonEditorRegistry.registerEditorAction2(new ExecCommandCopyAction());
CommonEditorRegistry.registerEditorAction(new ExecCommandCopyAction());
}
if (browser.supportsExecCommand('paste')) {
CommonEditorRegistry.registerEditorAction2(new ExecCommandPasteAction());
CommonEditorRegistry.registerEditorAction(new ExecCommandPasteAction());
}
function execCommandToHandler(actionId: string, browserCommand: string, accessor: ServicesAccessor, args: any): void {

View file

@ -7,12 +7,12 @@
import * as nls from 'vs/nls';
import {KeyCode, KeyMod} from 'vs/base/common/keyCodes';
import {ICommand, ICommonCodeEditor} from 'vs/editor/common/editorCommon';
import {EditorKbExpr, EditorAction2, CommonEditorRegistry, ServicesAccessor} from 'vs/editor/common/editorCommonExtensions';
import {EditorKbExpr, EditorAction, CommonEditorRegistry, ServicesAccessor} from 'vs/editor/common/editorCommonExtensions';
import {BlockCommentCommand} from './blockCommentCommand';
import {LineCommentCommand, Type} from './lineCommentCommand';
import {KbExpr} from 'vs/platform/keybinding/common/keybinding';
abstract class CommentLineAction extends EditorAction2 {
abstract class CommentLineAction extends EditorAction {
private _type: Type;
@ -91,7 +91,7 @@ class RemoveLineCommentAction extends CommentLineAction {
}
}
class BlockCommentAction extends EditorAction2 {
class BlockCommentAction extends EditorAction {
constructor() {
super(
@ -121,7 +121,7 @@ class BlockCommentAction extends EditorAction2 {
}
// register actions
CommonEditorRegistry.registerEditorAction2(new ToggleCommentLineAction());
CommonEditorRegistry.registerEditorAction2(new AddLineCommentAction());
CommonEditorRegistry.registerEditorAction2(new RemoveLineCommentAction());
CommonEditorRegistry.registerEditorAction2(new BlockCommentAction());
CommonEditorRegistry.registerEditorAction(new ToggleCommentLineAction());
CommonEditorRegistry.registerEditorAction(new AddLineCommentAction());
CommonEditorRegistry.registerEditorAction(new RemoveLineCommentAction());
CommonEditorRegistry.registerEditorAction(new BlockCommentAction());

View file

@ -16,7 +16,7 @@ import {IContextMenuService, IContextViewService} from 'vs/platform/contextview/
import {IKeybindingService} from 'vs/platform/keybinding/common/keybinding';
import {IMenuService, IMenu, MenuId} from 'vs/platform/actions/common/actions';
import {ICommonCodeEditor, IEditorContribution, MouseTargetType} from 'vs/editor/common/editorCommon';
import {ServicesAccessor, EditorKbExpr, EditorAction2, CommonEditorRegistry} from 'vs/editor/common/editorCommonExtensions';
import {ServicesAccessor, EditorKbExpr, EditorAction, CommonEditorRegistry} from 'vs/editor/common/editorCommonExtensions';
import {ICodeEditor, IEditorMouseEvent} from 'vs/editor/browser/editorBrowser';
import {EditorBrowserRegistry} from 'vs/editor/browser/editorBrowserExtensions';
@ -218,7 +218,7 @@ class ContextMenuController implements IEditorContribution {
}
}
class ShowContextMenu extends EditorAction2 {
class ShowContextMenu extends EditorAction {
constructor() {
super(
@ -241,4 +241,4 @@ class ShowContextMenu extends EditorAction2 {
}
EditorBrowserRegistry.registerEditorContribution(ContextMenuController);
CommonEditorRegistry.registerEditorAction2(new ShowContextMenu());
CommonEditorRegistry.registerEditorAction(new ShowContextMenu());

View file

@ -19,7 +19,7 @@ import {IOSupport} from 'vs/platform/keybinding/common/keybindingResolver';
import {IKeybindingService} from 'vs/platform/keybinding/common/keybinding';
import {Range} from 'vs/editor/common/core/range';
import * as editorCommon from 'vs/editor/common/editorCommon';
import {ServicesAccessor, EditorKbExpr, EditorAction2, CommonEditorRegistry} from 'vs/editor/common/editorCommonExtensions';
import {ServicesAccessor, EditorKbExpr, EditorAction, CommonEditorRegistry} from 'vs/editor/common/editorCommonExtensions';
import {ICodeEditor, IOverlayWidget, IOverlayWidgetPosition, OverlayWidgetPositionPreference} from 'vs/editor/browser/editorBrowser';
import {EditorBrowserRegistry} from 'vs/editor/browser/editorBrowserExtensions';
import {CodeSnippet, getSnippetController} from 'vs/editor/contrib/snippet/common/snippet';
@ -443,7 +443,7 @@ class DefineKeybindingWidget implements IOverlayWidget {
}
}
export class DefineKeybindingAction extends EditorAction2 {
export class DefineKeybindingAction extends EditorAction {
static ID = 'editor.action.defineKeybinding';
@ -488,4 +488,4 @@ function isInterestingEditorModel(editor:editorCommon.ICommonCodeEditor): boolea
}
EditorBrowserRegistry.registerEditorContribution(DefineKeybindingController);
CommonEditorRegistry.registerEditorAction2(new DefineKeybindingAction());
CommonEditorRegistry.registerEditorAction(new DefineKeybindingAction());

View file

@ -12,7 +12,7 @@ import {Range} from 'vs/editor/common/core/range';
import {Selection} from 'vs/editor/common/core/selection';
import * as strings from 'vs/base/common/strings';
import * as editorCommon from 'vs/editor/common/editorCommon';
import {ServicesAccessor, EditorKbExpr, EditorAction2, CommonEditorRegistry} from 'vs/editor/common/editorCommonExtensions';
import {ServicesAccessor, EditorKbExpr, EditorAction, CommonEditorRegistry} from 'vs/editor/common/editorCommonExtensions';
import {FIND_IDS, FindModelBoundToEditorModel} from 'vs/editor/contrib/find/common/findModel';
import {FindReplaceState, FindReplaceStateChangedEvent, INewFindReplaceState} from 'vs/editor/contrib/find/common/findState';
import {DocumentHighlightProviderRegistry} from 'vs/editor/common/modes';
@ -230,7 +230,7 @@ export class CommonFindController extends Disposable implements editorCommon.IEd
}
}
export class StartFindAction extends EditorAction2 {
export class StartFindAction extends EditorAction {
constructor() {
super(
@ -257,7 +257,7 @@ export class StartFindAction extends EditorAction2 {
}
}
export abstract class MatchFindAction extends EditorAction2 {
export abstract class MatchFindAction extends EditorAction {
constructor(id:string, label:string, alias:string) {
super(id, label, alias, false);
}
@ -320,7 +320,7 @@ export class PreviousMatchFindAction extends MatchFindAction {
}
}
export abstract class SelectionMatchFindAction extends EditorAction2 {
export abstract class SelectionMatchFindAction extends EditorAction {
constructor(id:string, label:string, alias:string) {
super(id, label, alias, false);
@ -386,7 +386,7 @@ export class PreviousSelectionMatchFindAction extends SelectionMatchFindAction {
}
}
export class StartFindReplaceAction extends EditorAction2 {
export class StartFindReplaceAction extends EditorAction {
constructor() {
super(
@ -472,7 +472,7 @@ function multiCursorFind(editor:editorCommon.ICommonCodeEditor, changeFindSearch
};
}
export abstract class SelectNextFindMatchAction extends EditorAction2 {
export abstract class SelectNextFindMatchAction extends EditorAction {
constructor(id:string, label:string, alias:string) {
super(id, label, alias, false);
@ -500,7 +500,7 @@ export abstract class SelectNextFindMatchAction extends EditorAction2 {
}
}
export abstract class SelectPreviousFindMatchAction extends EditorAction2 {
export abstract class SelectPreviousFindMatchAction extends EditorAction {
constructor(id:string, label:string, alias:string) {
super(id, label, alias, false);
@ -632,7 +632,7 @@ export class MoveSelectionToPreviousFindMatchAction extends SelectPreviousFindMa
}
}
export abstract class AbstractSelectHighlightsAction extends EditorAction2 {
export abstract class AbstractSelectHighlightsAction extends EditorAction {
constructor(id:string, label:string, alias:string) {
super(id, label, alias, false);
@ -856,22 +856,22 @@ export class SelectionHighlighter extends Disposable implements editorCommon.IEd
}
CommonEditorRegistry.registerEditorAction2(new SelectHighlightsAction());
CommonEditorRegistry.registerEditorAction(new SelectHighlightsAction());
// register SelectHighlightsAction again to replace the now removed Change All action
CommonEditorRegistry.registerEditorAction2(new CompatChangeAll());
CommonEditorRegistry.registerEditorAction(new CompatChangeAll());
// register actions
CommonEditorRegistry.registerEditorAction2(new StartFindAction());
CommonEditorRegistry.registerEditorAction2(new NextMatchFindAction());
CommonEditorRegistry.registerEditorAction2(new PreviousMatchFindAction());
CommonEditorRegistry.registerEditorAction2(new NextSelectionMatchFindAction());
CommonEditorRegistry.registerEditorAction2(new PreviousSelectionMatchFindAction());
CommonEditorRegistry.registerEditorAction2(new StartFindReplaceAction());
CommonEditorRegistry.registerEditorAction2(new MoveSelectionToNextFindMatchAction());
CommonEditorRegistry.registerEditorAction2(new MoveSelectionToPreviousFindMatchAction());
CommonEditorRegistry.registerEditorAction(new StartFindAction());
CommonEditorRegistry.registerEditorAction(new NextMatchFindAction());
CommonEditorRegistry.registerEditorAction(new PreviousMatchFindAction());
CommonEditorRegistry.registerEditorAction(new NextSelectionMatchFindAction());
CommonEditorRegistry.registerEditorAction(new PreviousSelectionMatchFindAction());
CommonEditorRegistry.registerEditorAction(new StartFindReplaceAction());
CommonEditorRegistry.registerEditorAction(new MoveSelectionToNextFindMatchAction());
CommonEditorRegistry.registerEditorAction(new MoveSelectionToPreviousFindMatchAction());
CommonEditorRegistry.registerEditorAction2(new AddSelectionToNextFindMatchAction());
CommonEditorRegistry.registerEditorAction2(new AddSelectionToPreviousFindMatchAction());
CommonEditorRegistry.registerEditorAction(new AddSelectionToNextFindMatchAction());
CommonEditorRegistry.registerEditorAction(new AddSelectionToPreviousFindMatchAction());
function registerFindCommand(id:string, callback:(controller:CommonFindController)=>void, keybindings:IKeybindings, needsKey:string = null): void {
CommonEditorRegistry.registerEditorCommand(id, CommonEditorRegistry.commandWeight(5), keybindings, false, needsKey, (ctx, editor, args) => {

View file

@ -13,7 +13,7 @@ import {IDisposable, dispose} from 'vs/base/common/lifecycle';
import {TPromise} from 'vs/base/common/winjs.base';
import * as editorCommon from 'vs/editor/common/editorCommon';
import {Range} from 'vs/editor/common/core/range';
import {ServicesAccessor, EditorKbExpr, EditorAction2, CommonEditorRegistry} from 'vs/editor/common/editorCommonExtensions';
import {ServicesAccessor, EditorKbExpr, EditorAction, CommonEditorRegistry} from 'vs/editor/common/editorCommonExtensions';
import {ICodeEditor, IEditorMouseEvent} from 'vs/editor/browser/editorBrowser';
import {EditorBrowserRegistry} from 'vs/editor/browser/editorBrowserExtensions';
import {IFoldingRange} from 'vs/editor/contrib/folding/common/foldingRange';
@ -646,7 +646,7 @@ export class FoldingController implements editorCommon.IEditorContribution {
}
}
abstract class FoldingAction2 extends EditorAction2 {
abstract class FoldingAction2 extends EditorAction {
constructor(id:string, label:string, alias:string, keybinding:number) {
super(id, label, alias, false);
@ -784,13 +784,13 @@ class FoldLevelAction extends FoldingAction2 {
EditorBrowserRegistry.registerEditorContribution(FoldingController);
CommonEditorRegistry.registerEditorAction2(new UnfoldAction());
CommonEditorRegistry.registerEditorAction2(new UnFoldRecursivelyAction());
CommonEditorRegistry.registerEditorAction2(new FoldAction());
CommonEditorRegistry.registerEditorAction2(new FoldRecursivelyAction());
CommonEditorRegistry.registerEditorAction2(new FoldAllAction());
CommonEditorRegistry.registerEditorAction2(new UnfoldAllAction());
CommonEditorRegistry.registerEditorAction2(
CommonEditorRegistry.registerEditorAction(new UnfoldAction());
CommonEditorRegistry.registerEditorAction(new UnFoldRecursivelyAction());
CommonEditorRegistry.registerEditorAction(new FoldAction());
CommonEditorRegistry.registerEditorAction(new FoldRecursivelyAction());
CommonEditorRegistry.registerEditorAction(new FoldAllAction());
CommonEditorRegistry.registerEditorAction(new UnfoldAllAction());
CommonEditorRegistry.registerEditorAction(
new FoldLevelAction(
FoldLevelAction.ID(1),
nls.localize('foldLevel1Action.label', "Fold Level 1"),
@ -798,7 +798,7 @@ CommonEditorRegistry.registerEditorAction2(
KeyMod.chord(KeyMod.CtrlCmd | KeyCode.KEY_K, KeyMod.CtrlCmd | KeyCode.KEY_1)
)
);
CommonEditorRegistry.registerEditorAction2(
CommonEditorRegistry.registerEditorAction(
new FoldLevelAction(
FoldLevelAction.ID(2),
nls.localize('foldLevel2Action.label', "Fold Level 2"),
@ -806,7 +806,7 @@ CommonEditorRegistry.registerEditorAction2(
KeyMod.chord(KeyMod.CtrlCmd | KeyCode.KEY_K, KeyMod.CtrlCmd | KeyCode.KEY_2)
)
);
CommonEditorRegistry.registerEditorAction2(
CommonEditorRegistry.registerEditorAction(
new FoldLevelAction(
FoldLevelAction.ID(3),
nls.localize('foldLevel3Action.label', "Fold Level 3"),
@ -814,7 +814,7 @@ CommonEditorRegistry.registerEditorAction2(
KeyMod.chord(KeyMod.CtrlCmd | KeyCode.KEY_K, KeyMod.CtrlCmd | KeyCode.KEY_3)
)
);
CommonEditorRegistry.registerEditorAction2(
CommonEditorRegistry.registerEditorAction(
new FoldLevelAction(
FoldLevelAction.ID(4),
nls.localize('foldLevel4Action.label', "Fold Level 4"),
@ -822,7 +822,7 @@ CommonEditorRegistry.registerEditorAction2(
KeyMod.chord(KeyMod.CtrlCmd | KeyCode.KEY_K, KeyMod.CtrlCmd | KeyCode.KEY_4)
)
);
CommonEditorRegistry.registerEditorAction2(
CommonEditorRegistry.registerEditorAction(
new FoldLevelAction(
FoldLevelAction.ID(5),
nls.localize('foldLevel5Action.label', "Fold Level 5"),

View file

@ -11,7 +11,7 @@ import {IDisposable, dispose} from 'vs/base/common/lifecycle';
import {TPromise} from 'vs/base/common/winjs.base';
import * as editorCommon from 'vs/editor/common/editorCommon';
import {KbExpr} from 'vs/platform/keybinding/common/keybinding';
import {ServicesAccessor, EditorKbExpr, EditorAction2, CommonEditorRegistry} from 'vs/editor/common/editorCommonExtensions';
import {ServicesAccessor, EditorKbExpr, EditorAction, CommonEditorRegistry} from 'vs/editor/common/editorCommonExtensions';
import {DocumentFormattingEditProviderRegistry, DocumentRangeFormattingEditProviderRegistry, OnTypeFormattingEditProviderRegistry} from 'vs/editor/common/modes';
import {getOnTypeFormattingEdits, getDocumentFormattingEdits, getDocumentRangeFormattingEdits} from '../common/format';
import {EditOperationsCommand} from './formatCommand';
@ -132,7 +132,7 @@ class FormatOnType implements editorCommon.IEditorContribution {
}
}
export class FormatAction extends EditorAction2 {
export class FormatAction extends EditorAction {
constructor() {
super(
@ -223,5 +223,5 @@ export class FormatAction extends EditorAction2 {
}
// register action
CommonEditorRegistry.registerEditorAction2(new FormatAction());
CommonEditorRegistry.registerEditorAction(new FormatAction());
CommonEditorRegistry.registerEditorContribution(FormatOnType);

View file

@ -22,7 +22,7 @@ import {IEditorService} from 'vs/platform/editor/common/editor';
import {IMessageService} from 'vs/platform/message/common/message';
import {Range} from 'vs/editor/common/core/range';
import * as editorCommon from 'vs/editor/common/editorCommon';
import {ServicesAccessor, EditorKbExpr, EditorAction2, CommonEditorRegistry} from 'vs/editor/common/editorCommonExtensions';
import {ServicesAccessor, EditorKbExpr, EditorAction, CommonEditorRegistry} from 'vs/editor/common/editorCommonExtensions';
import {Location, DefinitionProviderRegistry} from 'vs/editor/common/modes';
import {ICodeEditor, IEditorMouseEvent, IMouseTarget} from 'vs/editor/browser/editorBrowser';
import {EditorBrowserRegistry} from 'vs/editor/browser/editorBrowserExtensions';
@ -45,7 +45,7 @@ export class DefinitionActionConfig {
}
}
export class DefinitionAction extends EditorAction2 {
export class DefinitionAction extends EditorAction {
private _configuration: DefinitionActionConfig;
@ -517,8 +517,8 @@ class GotoDefinitionWithMouseEditorContribution implements editorCommon.IEditorC
// register actions
CommonEditorRegistry.registerEditorAction2(new PeekDefinitionAction());
CommonEditorRegistry.registerEditorAction2(new GoToDefinitionAction());
CommonEditorRegistry.registerEditorAction2(new OpenDefinitionToSideAction());
CommonEditorRegistry.registerEditorAction(new PeekDefinitionAction());
CommonEditorRegistry.registerEditorAction(new GoToDefinitionAction());
CommonEditorRegistry.registerEditorAction(new OpenDefinitionToSideAction());
EditorBrowserRegistry.registerEditorContribution(GotoDefinitionWithMouseEditorContribution);

View file

@ -23,7 +23,7 @@ import {ITelemetryService} from 'vs/platform/telemetry/common/telemetry';
import {Position} from 'vs/editor/common/core/position';
import {Range} from 'vs/editor/common/core/range';
import * as editorCommon from 'vs/editor/common/editorCommon';
import {ServicesAccessor, EditorKbExpr, EditorAction2, CommonEditorRegistry} from 'vs/editor/common/editorCommonExtensions';
import {ServicesAccessor, EditorKbExpr, EditorAction, CommonEditorRegistry} from 'vs/editor/common/editorCommonExtensions';
import {ICodeEditor} from 'vs/editor/browser/editorBrowser';
import {EditorBrowserRegistry} from 'vs/editor/browser/editorBrowserExtensions';
import {ZoneWidget} from 'vs/editor/contrib/zoneWidget/browser/zoneWidget';
@ -406,7 +406,7 @@ class MarkerNavigationWidget extends ZoneWidget {
}
}
class MarkerNavigationAction extends EditorAction2 {
class MarkerNavigationAction extends EditorAction {
private _isNext: boolean;
@ -545,8 +545,8 @@ class PrevMarkerAction extends MarkerNavigationAction {
var CONTEXT_MARKERS_NAVIGATION_VISIBLE = 'markersNavigationVisible';
// register actions
CommonEditorRegistry.registerEditorAction2(new NextMarkerAction());
CommonEditorRegistry.registerEditorAction2(new PrevMarkerAction());
CommonEditorRegistry.registerEditorAction(new NextMarkerAction());
CommonEditorRegistry.registerEditorAction(new PrevMarkerAction());
CommonEditorRegistry.registerEditorCommand('closeMarkersNavigation', CommonEditorRegistry.commandWeight(50), { primary: KeyCode.Escape, secondary: [KeyMod.Shift | KeyCode.Escape] }, false, CONTEXT_MARKERS_NAVIGATION_VISIBLE, (ctx, editor, args) => {
var controller = MarkerController.getMarkerController(editor);
controller.closeMarkersNavigation();

View file

@ -14,7 +14,7 @@ import {IOpenerService} from 'vs/platform/opener/common/opener';
import {IModeService} from 'vs/editor/common/services/modeService';
import {Range} from 'vs/editor/common/core/range';
import * as editorCommon from 'vs/editor/common/editorCommon';
import {ServicesAccessor, EditorKbExpr, EditorAction2, CommonEditorRegistry} from 'vs/editor/common/editorCommonExtensions';
import {ServicesAccessor, EditorKbExpr, EditorAction, CommonEditorRegistry} from 'vs/editor/common/editorCommonExtensions';
import {ICodeEditor, IEditorMouseEvent} from 'vs/editor/browser/editorBrowser';
import {EditorBrowserRegistry} from 'vs/editor/browser/editorBrowserExtensions';
import {ModesContentHoverWidget} from './modesContentHover';
@ -141,7 +141,7 @@ class ModesHoverController implements editorCommon.IEditorContribution {
}
}
class ShowHoverAction extends EditorAction2 {
class ShowHoverAction extends EditorAction {
constructor() {
super(
@ -165,4 +165,4 @@ class ShowHoverAction extends EditorAction2 {
}
EditorBrowserRegistry.registerEditorContribution(ModesHoverController);
CommonEditorRegistry.registerEditorAction2(new ShowHoverAction());
CommonEditorRegistry.registerEditorAction(new ShowHoverAction());

View file

@ -9,7 +9,7 @@ import {KeyCode, KeyMod} from 'vs/base/common/keyCodes';
import {TPromise} from 'vs/base/common/winjs.base';
import {Range} from 'vs/editor/common/core/range';
import {IEditorContribution, CodeEditorStateFlag, ICommonCodeEditor, IModelDecorationsChangeAccessor} from 'vs/editor/common/editorCommon';
import {ServicesAccessor, EditorKbExpr, EditorAction2, CommonEditorRegistry} from 'vs/editor/common/editorCommonExtensions';
import {ServicesAccessor, EditorKbExpr, EditorAction, CommonEditorRegistry} from 'vs/editor/common/editorCommonExtensions';
import {IInplaceReplaceSupportResult} from 'vs/editor/common/modes';
import {IEditorWorkerService} from 'vs/editor/common/services/editorWorkerService';
import {InPlaceReplaceCommand} from './inPlaceReplaceCommand';
@ -125,7 +125,7 @@ class InPlaceReplaceController implements IEditorContribution {
}
}
class InPlaceReplaceUp extends EditorAction2 {
class InPlaceReplaceUp extends EditorAction {
constructor() {
super(
@ -146,7 +146,7 @@ class InPlaceReplaceUp extends EditorAction2 {
}
}
class InPlaceReplaceDown extends EditorAction2 {
class InPlaceReplaceDown extends EditorAction {
constructor() {
super(
@ -168,5 +168,5 @@ class InPlaceReplaceDown extends EditorAction2 {
}
CommonEditorRegistry.registerEditorContribution(InPlaceReplaceController);
CommonEditorRegistry.registerEditorAction2(new InPlaceReplaceUp());
CommonEditorRegistry.registerEditorAction2(new InPlaceReplaceDown());
CommonEditorRegistry.registerEditorAction(new InPlaceReplaceUp());
CommonEditorRegistry.registerEditorAction(new InPlaceReplaceDown());

View file

@ -6,12 +6,12 @@
import * as nls from 'vs/nls';
import {TPromise} from 'vs/base/common/winjs.base';
import {ICommonCodeEditor} from 'vs/editor/common/editorCommon';
import {ServicesAccessor, EditorAction2, CommonEditorRegistry} from 'vs/editor/common/editorCommonExtensions';
import {ServicesAccessor, EditorAction, CommonEditorRegistry} from 'vs/editor/common/editorCommonExtensions';
import {IndentationToSpacesCommand, IndentationToTabsCommand} from 'vs/editor/contrib/indentation/common/indentationCommands';
import {IQuickOpenService} from 'vs/workbench/services/quickopen/common/quickOpenService';
import {IModelService} from 'vs/editor/common/services/modelService';
export class IndentationToSpacesAction extends EditorAction2 {
export class IndentationToSpacesAction extends EditorAction {
static ID = 'editor.action.indentationToSpaces';
constructor() {
@ -37,7 +37,7 @@ export class IndentationToSpacesAction extends EditorAction2 {
}
}
export class IndentationToTabsAction extends EditorAction2 {
export class IndentationToTabsAction extends EditorAction {
static ID = 'editor.action.indentationToTabs';
constructor() {
@ -63,7 +63,7 @@ export class IndentationToTabsAction extends EditorAction2 {
}
}
export class ChangeIndentationSizeAction extends EditorAction2 {
export class ChangeIndentationSizeAction extends EditorAction {
constructor(id: string, label: string, alias: string, private insertSpaces: boolean) {
super(id, label, alias, false);
@ -130,7 +130,7 @@ export class IndentUsingSpaces extends ChangeIndentationSizeAction {
}
}
export class DetectIndentation extends EditorAction2 {
export class DetectIndentation extends EditorAction {
static ID = 'editor.action.detectIndentation';
@ -156,7 +156,7 @@ export class DetectIndentation extends EditorAction2 {
}
}
export class ToggleRenderWhitespaceAction extends EditorAction2 {
export class ToggleRenderWhitespaceAction extends EditorAction {
constructor() {
super(
@ -174,7 +174,7 @@ export class ToggleRenderWhitespaceAction extends EditorAction2 {
}
}
export class ToggleRenderControlCharacterAction extends EditorAction2 {
export class ToggleRenderControlCharacterAction extends EditorAction {
constructor() {
super(
@ -193,10 +193,10 @@ export class ToggleRenderControlCharacterAction extends EditorAction2 {
}
// register actions
CommonEditorRegistry.registerEditorAction2(new IndentationToSpacesAction());
CommonEditorRegistry.registerEditorAction2(new IndentationToTabsAction());
CommonEditorRegistry.registerEditorAction2(new IndentUsingSpaces());
CommonEditorRegistry.registerEditorAction2(new IndentUsingTabs());
CommonEditorRegistry.registerEditorAction2(new DetectIndentation());
CommonEditorRegistry.registerEditorAction2(new ToggleRenderWhitespaceAction());
CommonEditorRegistry.registerEditorAction2(new ToggleRenderControlCharacterAction());
CommonEditorRegistry.registerEditorAction(new IndentationToSpacesAction());
CommonEditorRegistry.registerEditorAction(new IndentationToTabsAction());
CommonEditorRegistry.registerEditorAction(new IndentUsingSpaces());
CommonEditorRegistry.registerEditorAction(new IndentUsingTabs());
CommonEditorRegistry.registerEditorAction(new DetectIndentation());
CommonEditorRegistry.registerEditorAction(new ToggleRenderWhitespaceAction());
CommonEditorRegistry.registerEditorAction(new ToggleRenderControlCharacterAction());

View file

@ -9,14 +9,14 @@ import {KeyCode, KeyMod} from 'vs/base/common/keyCodes';
import {SortLinesCommand} from 'vs/editor/contrib/linesOperations/common/sortLinesCommand';
import {TrimTrailingWhitespaceCommand} from 'vs/editor/common/commands/trimTrailingWhitespaceCommand';
import {Handler, ICommand, ICommonCodeEditor} from 'vs/editor/common/editorCommon';
import {ServicesAccessor, EditorKbExpr, EditorAction2, HandlerEditorAction2, CommonEditorRegistry} from 'vs/editor/common/editorCommonExtensions';
import {ServicesAccessor, EditorKbExpr, EditorAction, HandlerEditorAction, CommonEditorRegistry} from 'vs/editor/common/editorCommonExtensions';
import {CopyLinesCommand} from './copyLinesCommand';
import {DeleteLinesCommand} from './deleteLinesCommand';
import {MoveLinesCommand} from './moveLinesCommand';
// copy lines
abstract class AbstractCopyLinesAction extends EditorAction2 {
abstract class AbstractCopyLinesAction extends EditorAction {
private down:boolean;
@ -74,7 +74,7 @@ class CopyLinesDownAction extends AbstractCopyLinesAction {
// move lines
abstract class AbstractMoveLinesAction extends EditorAction2 {
abstract class AbstractMoveLinesAction extends EditorAction {
private down:boolean;
@ -130,7 +130,7 @@ class MoveLinesDownAction extends AbstractMoveLinesAction {
}
}
abstract class AbstractSortLinesAction extends EditorAction2 {
abstract class AbstractSortLinesAction extends EditorAction {
private descending:boolean;
constructor(id:string, label:string, alias:string, descending:boolean) {
@ -182,7 +182,7 @@ class SortLinesDescendingAction extends AbstractSortLinesAction {
}
}
export class TrimTrailingWhitespaceAction extends EditorAction2 {
export class TrimTrailingWhitespaceAction extends EditorAction {
static ID = 'editor.action.trimTrailingWhitespace';
@ -216,7 +216,7 @@ interface IDeleteLinesOperation {
positionColumn:number;
}
abstract class AbstractRemoveLinesAction extends EditorAction2 {
abstract class AbstractRemoveLinesAction extends EditorAction {
constructor(id:string, label:string, alias:string) {
super(id, label, alias, true);
@ -292,7 +292,7 @@ class DeleteLinesAction extends AbstractRemoveLinesAction {
}
}
class IndentLinesAction extends HandlerEditorAction2 {
class IndentLinesAction extends HandlerEditorAction {
constructor() {
super(
'editor.action.indentLines',
@ -309,7 +309,7 @@ class IndentLinesAction extends HandlerEditorAction2 {
}
}
class OutdentLinesAction extends HandlerEditorAction2 {
class OutdentLinesAction extends HandlerEditorAction {
constructor() {
super(
'editor.action.outdentLines',
@ -326,7 +326,7 @@ class OutdentLinesAction extends HandlerEditorAction2 {
}
}
class InsertLineBeforeAction extends HandlerEditorAction2 {
class InsertLineBeforeAction extends HandlerEditorAction {
constructor() {
super(
'editor.action.insertLineBefore',
@ -343,7 +343,7 @@ class InsertLineBeforeAction extends HandlerEditorAction2 {
}
}
class InsertLineAfterAction extends HandlerEditorAction2 {
class InsertLineAfterAction extends HandlerEditorAction {
constructor() {
super(
'editor.action.insertLineAfter',
@ -361,15 +361,15 @@ class InsertLineAfterAction extends HandlerEditorAction2 {
}
// register actions
CommonEditorRegistry.registerEditorAction2(new DeleteLinesAction());
CommonEditorRegistry.registerEditorAction2(new SortLinesAscendingAction());
CommonEditorRegistry.registerEditorAction2(new SortLinesDescendingAction());
CommonEditorRegistry.registerEditorAction2(new TrimTrailingWhitespaceAction());
CommonEditorRegistry.registerEditorAction2(new MoveLinesDownAction());
CommonEditorRegistry.registerEditorAction2(new MoveLinesUpAction());
CommonEditorRegistry.registerEditorAction2(new CopyLinesDownAction());
CommonEditorRegistry.registerEditorAction2(new CopyLinesUpAction());
CommonEditorRegistry.registerEditorAction2(new IndentLinesAction());
CommonEditorRegistry.registerEditorAction2(new OutdentLinesAction());
CommonEditorRegistry.registerEditorAction2(new InsertLineBeforeAction());
CommonEditorRegistry.registerEditorAction2(new InsertLineAfterAction());
CommonEditorRegistry.registerEditorAction(new DeleteLinesAction());
CommonEditorRegistry.registerEditorAction(new SortLinesAscendingAction());
CommonEditorRegistry.registerEditorAction(new SortLinesDescendingAction());
CommonEditorRegistry.registerEditorAction(new TrimTrailingWhitespaceAction());
CommonEditorRegistry.registerEditorAction(new MoveLinesDownAction());
CommonEditorRegistry.registerEditorAction(new MoveLinesUpAction());
CommonEditorRegistry.registerEditorAction(new CopyLinesDownAction());
CommonEditorRegistry.registerEditorAction(new CopyLinesUpAction());
CommonEditorRegistry.registerEditorAction(new IndentLinesAction());
CommonEditorRegistry.registerEditorAction(new OutdentLinesAction());
CommonEditorRegistry.registerEditorAction(new InsertLineBeforeAction());
CommonEditorRegistry.registerEditorAction(new InsertLineAfterAction());

View file

@ -16,7 +16,7 @@ import {IKeyboardEvent} from 'vs/base/browser/keyboardEvent';
import {IMessageService} from 'vs/platform/message/common/message';
import {IOpenerService} from 'vs/platform/opener/common/opener';
import * as editorCommon from 'vs/editor/common/editorCommon';
import {ServicesAccessor, EditorAction2, CommonEditorRegistry} from 'vs/editor/common/editorCommonExtensions';
import {ServicesAccessor, EditorAction, CommonEditorRegistry} from 'vs/editor/common/editorCommonExtensions';
import {LinkProviderRegistry} from 'vs/editor/common/modes';
import {IEditorWorkerService} from 'vs/editor/common/services/editorWorkerService';
import {IEditorMouseEvent, ICodeEditor} from 'vs/editor/browser/editorBrowser';
@ -315,7 +315,7 @@ class LinkDetector implements editorCommon.IEditorContribution {
}
}
class OpenLinkAction extends EditorAction2 {
class OpenLinkAction extends EditorAction {
constructor() {
super(
@ -344,5 +344,5 @@ class OpenLinkAction extends EditorAction2 {
}
}
CommonEditorRegistry.registerEditorAction2(new OpenLinkAction());
CommonEditorRegistry.registerEditorAction(new OpenLinkAction());
EditorBrowserRegistry.registerEditorContribution(LinkDetector);

View file

@ -7,9 +7,9 @@
import * as nls from 'vs/nls';
import {KeyCode, KeyMod} from 'vs/base/common/keyCodes';
import {Handler, ICommonCodeEditor, ISelection} from 'vs/editor/common/editorCommon';
import {ServicesAccessor, EditorKbExpr, EditorAction2, HandlerEditorAction2, CommonEditorRegistry} from 'vs/editor/common/editorCommonExtensions';
import {ServicesAccessor, EditorKbExpr, EditorAction, HandlerEditorAction, CommonEditorRegistry} from 'vs/editor/common/editorCommonExtensions';
class InsertCursorAbove extends HandlerEditorAction2 {
class InsertCursorAbove extends HandlerEditorAction {
constructor() {
super(
'editor.action.insertCursorAbove',
@ -30,7 +30,7 @@ class InsertCursorAbove extends HandlerEditorAction2 {
}
}
class InsertCursorBelow extends HandlerEditorAction2 {
class InsertCursorBelow extends HandlerEditorAction {
constructor() {
super(
'editor.action.insertCursorBelow',
@ -51,7 +51,7 @@ class InsertCursorBelow extends HandlerEditorAction2 {
}
}
class InsertCursorAtEndOfEachLineSelected extends EditorAction2 {
class InsertCursorAtEndOfEachLineSelected extends EditorAction {
constructor() {
super(
@ -101,6 +101,6 @@ class InsertCursorAtEndOfEachLineSelected extends EditorAction2 {
// register actions
CommonEditorRegistry.registerEditorAction2(new InsertCursorAbove());
CommonEditorRegistry.registerEditorAction2(new InsertCursorBelow());
CommonEditorRegistry.registerEditorAction2(new InsertCursorAtEndOfEachLineSelected());
CommonEditorRegistry.registerEditorAction(new InsertCursorAbove());
CommonEditorRegistry.registerEditorAction(new InsertCursorBelow());
CommonEditorRegistry.registerEditorAction(new InsertCursorAtEndOfEachLineSelected());

View file

@ -12,7 +12,7 @@ import { ICommonCodeEditor, IEditorContribution, KEYBINDING_CONTEXT_EDITOR_TEXT_
import { KbExpr } from 'vs/platform/keybinding/common/keybinding';
import { KeybindingsRegistry } from 'vs/platform/keybinding/common/keybindingsRegistry';
import { withCodeEditorFromCommandHandler } from 'vs/editor/common/config/config';
import { ServicesAccessor, EditorKbExpr, EditorAction2, CommonEditorRegistry } from 'vs/editor/common/editorCommonExtensions';
import { ServicesAccessor, EditorKbExpr, EditorAction, CommonEditorRegistry } from 'vs/editor/common/editorCommonExtensions';
import { ICodeEditor } from 'vs/editor/browser/editorBrowser';
import { EditorBrowserRegistry } from 'vs/editor/browser/editorBrowserExtensions';
import { SignatureHelpProviderRegistry } from 'vs/editor/common/modes';
@ -60,7 +60,7 @@ class ParameterHintsController implements IEditorContribution {
}
}
export class TriggerParameterHintsAction extends EditorAction2 {
export class TriggerParameterHintsAction extends EditorAction {
constructor() {
super(
@ -98,7 +98,7 @@ function handler(id: string, fn: (controller: ParameterHintsController) => void)
EditorBrowserRegistry.registerEditorContribution(ParameterHintsController);
CommonEditorRegistry.registerEditorAction2(new TriggerParameterHintsAction());
CommonEditorRegistry.registerEditorAction(new TriggerParameterHintsAction());
KeybindingsRegistry.registerCommandDesc({
id: 'closeParameterHints',

View file

@ -14,7 +14,7 @@ import {IMarkerService} from 'vs/platform/markers/common/markers';
import {IMessageService} from 'vs/platform/message/common/message';
import {ITelemetryService} from 'vs/platform/telemetry/common/telemetry';
import {ICommonCodeEditor, IEditorContribution, IRange} from 'vs/editor/common/editorCommon';
import {ServicesAccessor, EditorKbExpr, EditorAction2, CommonEditorRegistry} from 'vs/editor/common/editorCommonExtensions';
import {ServicesAccessor, EditorKbExpr, EditorAction, CommonEditorRegistry} from 'vs/editor/common/editorCommonExtensions';
import {ICodeEditor} from 'vs/editor/browser/editorBrowser';
import {CodeActionProviderRegistry} from 'vs/editor/common/modes';
import {EditorBrowserRegistry} from 'vs/editor/browser/editorBrowserExtensions';
@ -115,7 +115,7 @@ export class QuickFixController implements IEditorContribution {
}
}
export class QuickFixAction extends EditorAction2 {
export class QuickFixAction extends EditorAction {
constructor() {
super(
@ -148,7 +148,7 @@ var CONTEXT_QUICK_FIX_WIDGET_VISIBLE = 'quickFixWidgetVisible';
var weight = CommonEditorRegistry.commandWeight(80);
// register action
CommonEditorRegistry.registerEditorAction2(new QuickFixAction());
CommonEditorRegistry.registerEditorAction(new QuickFixAction());
CommonEditorRegistry.registerEditorCommand('acceptQuickFixSuggestion', weight, { primary: KeyCode.Enter, secondary: [KeyCode.Tab] }, false, CONTEXT_QUICK_FIX_WIDGET_VISIBLE,(ctx, editor, args) => {
var controller = QuickFixController.getQuickFixController(editor);
controller.acceptSelectedSuggestion();

View file

@ -11,7 +11,7 @@ import {ICodeEditor} from 'vs/editor/browser/editorBrowser';
import {EditorBrowserRegistry} from 'vs/editor/browser/editorBrowserExtensions';
import {QuickOpenEditorWidget} from './quickOpenEditorWidget';
import {Selection} from 'vs/editor/common/core/selection';
import {EditorAction2} from 'vs/editor/common/editorCommonExtensions';
import {EditorAction} from 'vs/editor/common/editorCommonExtensions';
export interface IQuickOpenControllerOpts {
inputAriaLabel: string;
@ -138,7 +138,7 @@ export interface IQuickOpenOpts {
/**
* Base class for providing quick open in the editor.
*/
export abstract class BaseEditorQuickOpenAction extends EditorAction2 {
export abstract class BaseEditorQuickOpenAction extends EditorAction {
private _inputAriaLabel:string;

View file

@ -8,4 +8,4 @@ import {CommonEditorRegistry} from 'vs/editor/common/editorCommonExtensions';
import {GotoLineAction} from './gotoLine';
// Contribute Ctrl+G to "Go to line" using quick open
CommonEditorRegistry.registerEditorAction2(new GotoLineAction());
CommonEditorRegistry.registerEditorAction(new GotoLineAction());

View file

@ -8,4 +8,4 @@ import {CommonEditorRegistry} from 'vs/editor/common/editorCommonExtensions';
import {QuickCommandAction} from './quickCommand';
// Contribute "Quick Command" to context menu
CommonEditorRegistry.registerEditorAction2(new QuickCommandAction());
CommonEditorRegistry.registerEditorAction(new QuickCommandAction());

View file

@ -8,4 +8,4 @@ import {CommonEditorRegistry} from 'vs/editor/common/editorCommonExtensions';
import {QuickOutlineAction} from './quickOutline';
// Contribute "Quick Outline" to context menu
CommonEditorRegistry.registerEditorAction2(new QuickOutlineAction());
CommonEditorRegistry.registerEditorAction(new QuickOutlineAction());

View file

@ -16,7 +16,7 @@ import {KeybindingsRegistry} from 'vs/platform/keybinding/common/keybindingsRegi
import {Position} from 'vs/editor/common/core/position';
import {Range} from 'vs/editor/common/core/range';
import * as editorCommon from 'vs/editor/common/editorCommon';
import {ServicesAccessor, EditorKbExpr, EditorAction2, CommonEditorRegistry} from 'vs/editor/common/editorCommonExtensions';
import {ServicesAccessor, EditorKbExpr, EditorAction, CommonEditorRegistry} from 'vs/editor/common/editorCommonExtensions';
import {Location, ReferenceProviderRegistry} from 'vs/editor/common/modes';
import {IPeekViewService, getOuterEditor} from 'vs/editor/contrib/zoneWidget/browser/peekViewWidget';
import {provideReferences} from '../common/referenceSearch';
@ -52,7 +52,7 @@ export class ReferenceController implements editorCommon.IEditorContribution {
}
}
export class ReferenceAction extends EditorAction2 {
export class ReferenceAction extends EditorAction {
constructor() {
super(
@ -151,7 +151,7 @@ let showReferencesCommand: ICommandHandler = (accessor:ServicesAccessor, resourc
// register action
CommonEditorRegistry.registerEditorContribution(ReferenceController);
CommonEditorRegistry.registerEditorAction2(new ReferenceAction());
CommonEditorRegistry.registerEditorAction(new ReferenceAction());
KeybindingsRegistry.registerCommandDesc({
id: 'editor.action.findReferences',

View file

@ -16,7 +16,7 @@ import {IKeybindingContextKey, IKeybindingService, KbExpr} from 'vs/platform/key
import {IMessageService} from 'vs/platform/message/common/message';
import {IProgressService} from 'vs/platform/progress/common/progress';
import {IRange, ICommonCodeEditor} from 'vs/editor/common/editorCommon';
import {ServicesAccessor, EditorKbExpr, EditorAction2, CommonEditorRegistry} from 'vs/editor/common/editorCommonExtensions';
import {ServicesAccessor, EditorKbExpr, EditorAction, CommonEditorRegistry} from 'vs/editor/common/editorCommonExtensions';
import {EditorBrowserRegistry} from 'vs/editor/browser/editorBrowserExtensions';
import {KEYBINDING_CONTEXT_EDITOR_READONLY, ModeContextKeys, IEditorContribution} from 'vs/editor/common/editorCommon';
import {BulkEdit, createBulkEdit} from 'vs/editor/common/services/bulkEdit';
@ -147,7 +147,7 @@ class RenameController implements IEditorContribution {
// ---- action implementation
export class RenameAction extends EditorAction2 {
export class RenameAction extends EditorAction {
constructor() {
super(
@ -192,7 +192,7 @@ EditorBrowserRegistry.registerEditorContribution(RenameController);
const weight = CommonEditorRegistry.commandWeight(99);
CommonEditorRegistry.registerEditorAction2(new RenameAction());
CommonEditorRegistry.registerEditorAction(new RenameAction());
CommonEditorRegistry.registerEditorCommand('acceptRenameInput', weight, { primary: KeyCode.Enter }, false, CONTEXT_RENAME_INPUT_VISIBLE, (ctx, editor, args) => {
RenameController.get(editor).acceptRenameInput();

View file

@ -7,9 +7,9 @@
import * as nls from 'vs/nls';
import {KeyCode, KeyMod} from 'vs/base/common/keyCodes';
import {Handler} from 'vs/editor/common/editorCommon';
import {EditorKbExpr, HandlerEditorAction2, CommonEditorRegistry} from 'vs/editor/common/editorCommonExtensions';
import {EditorKbExpr, HandlerEditorAction, CommonEditorRegistry} from 'vs/editor/common/editorCommonExtensions';
class SelectBracketAction extends HandlerEditorAction2 {
class SelectBracketAction extends HandlerEditorAction {
static ID = 'editor.action.jumpToBracket';
@ -30,4 +30,4 @@ class SelectBracketAction extends HandlerEditorAction2 {
}
// register actions
CommonEditorRegistry.registerEditorAction2(new SelectBracketAction());
CommonEditorRegistry.registerEditorAction(new SelectBracketAction());

View file

@ -11,7 +11,7 @@ import {TPromise} from 'vs/base/common/winjs.base';
import {IInstantiationService} from 'vs/platform/instantiation/common/instantiation';
import {Range} from 'vs/editor/common/core/range';
import {ICommonCodeEditor, ICursorPositionChangedEvent, IEditorContribution} from 'vs/editor/common/editorCommon';
import {ServicesAccessor, EditorKbExpr, EditorAction2, CommonEditorRegistry} from 'vs/editor/common/editorCommonExtensions';
import {ServicesAccessor, EditorKbExpr, EditorAction, CommonEditorRegistry} from 'vs/editor/common/editorCommonExtensions';
import {TokenSelectionSupport, ILogicalSelectionEntry} from './tokenSelectionSupport';
// --- selection state machine
@ -142,7 +142,7 @@ class SmartSelectController implements IEditorContribution {
}
}
abstract class AbstractSmartSelect extends EditorAction2 {
abstract class AbstractSmartSelect extends EditorAction {
private _forward: boolean;
@ -192,5 +192,5 @@ class ShrinkSelectionAction extends AbstractSmartSelect {
// register actions
CommonEditorRegistry.registerEditorContribution(SmartSelectController);
CommonEditorRegistry.registerEditorAction2(new GrowSelectionAction());
CommonEditorRegistry.registerEditorAction2(new ShrinkSelectionAction());
CommonEditorRegistry.registerEditorAction(new GrowSelectionAction());
CommonEditorRegistry.registerEditorAction(new ShrinkSelectionAction());

View file

@ -10,7 +10,7 @@ import { IDisposable, dispose } from 'vs/base/common/lifecycle';
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
import { KbExpr } from 'vs/platform/keybinding/common/keybinding';
import { ICommonCodeEditor, IEditorContribution, KEYBINDING_CONTEXT_EDITOR_TEXT_FOCUS } from 'vs/editor/common/editorCommon';
import { ServicesAccessor, EditorKbExpr, EditorAction2, CommonEditorRegistry } from 'vs/editor/common/editorCommonExtensions';
import { ServicesAccessor, EditorKbExpr, EditorAction, CommonEditorRegistry } from 'vs/editor/common/editorCommonExtensions';
import { ISuggestSupport, SuggestRegistry } from 'vs/editor/common/modes';
import { ICodeEditor } from 'vs/editor/browser/editorBrowser';
import { EditorBrowserRegistry } from 'vs/editor/browser/editorBrowserExtensions';
@ -169,7 +169,7 @@ export class SuggestController implements IEditorContribution {
}
}
export class TriggerSuggestAction extends EditorAction2 {
export class TriggerSuggestAction extends EditorAction {
static ID: string = 'editor.action.triggerSuggest';
@ -200,7 +200,7 @@ export class TriggerSuggestAction extends EditorAction2 {
}
}
CommonEditorRegistry.registerEditorAction2(new TriggerSuggestAction());
CommonEditorRegistry.registerEditorAction(new TriggerSuggestAction());
const weight = CommonEditorRegistry.commandWeight(90);

View file

@ -8,7 +8,7 @@ import * as nls from 'vs/nls';
import {Registry} from 'vs/platform/platform';
import {TPromise} from 'vs/base/common/winjs.base';
import {ICommonCodeEditor} from 'vs/editor/common/editorCommon';
import {ServicesAccessor, EditorAction2, CommonEditorRegistry} from 'vs/editor/common/editorCommonExtensions';
import {ServicesAccessor, EditorAction, CommonEditorRegistry} from 'vs/editor/common/editorCommonExtensions';
import {getSnippetController, CodeSnippet} from 'vs/editor/contrib/snippet/common/snippet';
import {IQuickOpenService, IPickOpenEntry} from 'vs/workbench/services/quickopen/common/quickOpenService';
import {ISnippetsRegistry, Extensions, ISnippet} from 'vs/editor/common/modes/snippetsRegistry';
@ -17,7 +17,7 @@ interface ISnippetPick extends IPickOpenEntry {
snippet: ISnippet;
}
class ShowSnippetsActions extends EditorAction2 {
class ShowSnippetsActions extends EditorAction {
constructor() {
super(
@ -53,4 +53,4 @@ class ShowSnippetsActions extends EditorAction2 {
}
}
CommonEditorRegistry.registerEditorAction2(new ShowSnippetsActions());
CommonEditorRegistry.registerEditorAction(new ShowSnippetsActions());

View file

@ -7,11 +7,11 @@
import * as nls from 'vs/nls';
import {KeyCode, KeyMod} from 'vs/base/common/keyCodes';
import {ICommonCodeEditor} from 'vs/editor/common/editorCommon';
import {ServicesAccessor, EditorAction2, CommonEditorRegistry} from 'vs/editor/common/editorCommonExtensions';
import {ServicesAccessor, EditorAction, CommonEditorRegistry} from 'vs/editor/common/editorCommonExtensions';
import {TabFocus} from 'vs/editor/common/config/commonEditorConfig';
import {KeybindingsRegistry} from 'vs/platform/keybinding/common/keybindingsRegistry';
export class ToggleTabFocusModeAction extends EditorAction2 {
export class ToggleTabFocusModeAction extends EditorAction {
public static ID = 'editor.action.toggleTabFocusMode';
@ -31,7 +31,7 @@ export class ToggleTabFocusModeAction extends EditorAction2 {
}
// register actions
CommonEditorRegistry.registerEditorAction2(new ToggleTabFocusModeAction());
CommonEditorRegistry.registerEditorAction(new ToggleTabFocusModeAction());
KeybindingsRegistry.registerCommandRule({
id: ToggleTabFocusModeAction.ID,

View file

@ -7,9 +7,9 @@
import * as nls from 'vs/nls';
import {KeyCode, KeyMod} from 'vs/base/common/keyCodes';
import {ICommonCodeEditor} from 'vs/editor/common/editorCommon';
import {ServicesAccessor, EditorKbExpr, EditorAction2, CommonEditorRegistry} from 'vs/editor/common/editorCommonExtensions';
import {ServicesAccessor, EditorKbExpr, EditorAction, CommonEditorRegistry} from 'vs/editor/common/editorCommonExtensions';
class ToggleWordWrapAction extends EditorAction2 {
class ToggleWordWrapAction extends EditorAction {
constructor() {
super(
@ -43,4 +43,4 @@ class ToggleWordWrapAction extends EditorAction2 {
}
// register actions
CommonEditorRegistry.registerEditorAction2(new ToggleWordWrapAction());
CommonEditorRegistry.registerEditorAction(new ToggleWordWrapAction());

View file

@ -18,7 +18,7 @@ import {BreakpointWidget} from 'vs/workbench/parts/debug/browser/breakpointWidge
import {IPartService} from 'vs/workbench/services/part/common/partService';
import {IPanelService} from 'vs/workbench/services/panel/common/panelService';
import {IInstantiationService} from 'vs/platform/instantiation/common/instantiation';
import {ServicesAccessor, EditorKbExpr, EditorAction2} from 'vs/editor/common/editorCommonExtensions';
import {ServicesAccessor, EditorKbExpr, EditorAction} from 'vs/editor/common/editorCommonExtensions';
import {KeyMod, KeyCode} from 'vs/base/common/keyCodes';
import IDebugService = debug.IDebugService;
@ -516,7 +516,7 @@ export class EditConditionalBreakpointAction extends AbstractDebugAction {
}
}
export class ToggleBreakpointAction extends EditorAction2 {
export class ToggleBreakpointAction extends EditorAction {
constructor() {
super(
'editor.debug.action.toggleBreakpoint',
@ -546,7 +546,7 @@ export class ToggleBreakpointAction extends EditorAction2 {
}
}
export class EditorConditionalBreakpointAction extends EditorAction2 {
export class EditorConditionalBreakpointAction extends EditorAction {
constructor() {
super(
@ -590,7 +590,7 @@ export class SetValueAction extends AbstractDebugAction {
}
}
export class RunToCursorAction extends EditorAction2 {
export class RunToCursorAction extends EditorAction {
constructor() {
super(
@ -660,7 +660,7 @@ export class AddWatchExpressionAction extends AbstractDebugAction {
}
}
export class SelectionToReplAction extends EditorAction2 {
export class SelectionToReplAction extends EditorAction {
constructor() {
super(
@ -698,7 +698,7 @@ export class SelectionToReplAction extends EditorAction2 {
}
}
export class ShowDebugHoverAction extends EditorAction2 {
export class ShowDebugHoverAction extends EditorAction {
constructor() {
super(

View file

@ -50,11 +50,11 @@ class OpenDebugViewletAction extends viewlet.ToggleViewletAction {
}
EditorBrowserRegistry.registerEditorContribution(DebugEditorContribution);
CommonEditorRegistry.registerEditorAction2(new ToggleBreakpointAction());
CommonEditorRegistry.registerEditorAction2(new ShowDebugHoverAction());
CommonEditorRegistry.registerEditorAction2(new EditorConditionalBreakpointAction());
CommonEditorRegistry.registerEditorAction2(new SelectionToReplAction());
CommonEditorRegistry.registerEditorAction2(new RunToCursorAction());
CommonEditorRegistry.registerEditorAction(new ToggleBreakpointAction());
CommonEditorRegistry.registerEditorAction(new ShowDebugHoverAction());
CommonEditorRegistry.registerEditorAction(new EditorConditionalBreakpointAction());
CommonEditorRegistry.registerEditorAction(new SelectionToReplAction());
CommonEditorRegistry.registerEditorAction(new RunToCursorAction());
// register viewlet
(<viewlet.ViewletRegistry>platform.Registry.as(viewlet.Extensions.Viewlets)).registerViewlet(new viewlet.ViewletDescriptor(

View file

@ -32,5 +32,5 @@ class BalanceOutwardAction extends BasicEmmetEditorAction {
}
}
CommonEditorRegistry.registerEditorAction2(new BalanceInwardAction());
CommonEditorRegistry.registerEditorAction2(new BalanceOutwardAction());
CommonEditorRegistry.registerEditorAction(new BalanceInwardAction());
CommonEditorRegistry.registerEditorAction(new BalanceOutwardAction());

View file

@ -133,4 +133,4 @@ class EncodeDecodeDataUrlAction extends EmmetEditorAction {
}
}
CommonEditorRegistry.registerEditorAction2(new EncodeDecodeDataUrlAction());
CommonEditorRegistry.registerEditorAction(new EncodeDecodeDataUrlAction());

View file

@ -32,5 +32,5 @@ class NextEditPointAction extends BasicEmmetEditorAction {
}
}
CommonEditorRegistry.registerEditorAction2(new PreviousEditPointAction());
CommonEditorRegistry.registerEditorAction2(new NextEditPointAction());
CommonEditorRegistry.registerEditorAction(new PreviousEditPointAction());
CommonEditorRegistry.registerEditorAction(new NextEditPointAction());

View file

@ -21,4 +21,4 @@ class EvaluateMathAction extends BasicEmmetEditorAction {
}
}
CommonEditorRegistry.registerEditorAction2(new EvaluateMathAction());
CommonEditorRegistry.registerEditorAction(new EvaluateMathAction());

View file

@ -42,4 +42,4 @@ class ExpandAbbreviationAction extends BasicEmmetEditorAction {
}
}
CommonEditorRegistry.registerEditorAction2(new ExpandAbbreviationAction());
CommonEditorRegistry.registerEditorAction(new ExpandAbbreviationAction());

View file

@ -76,9 +76,9 @@ class DecrementNumberByTenAction extends BasicEmmetEditorAction {
}
}
CommonEditorRegistry.registerEditorAction2(new IncrementNumberByOneTenthAction());
CommonEditorRegistry.registerEditorAction2(new IncrementNumberByOneAction());
CommonEditorRegistry.registerEditorAction2(new IncrementNumberByTenAction());
CommonEditorRegistry.registerEditorAction2(new DecrementNumberByOneTenthAction());
CommonEditorRegistry.registerEditorAction2(new DecrementNumberByOneAction());
CommonEditorRegistry.registerEditorAction2(new DecrementNumberByTenAction());
CommonEditorRegistry.registerEditorAction(new IncrementNumberByOneTenthAction());
CommonEditorRegistry.registerEditorAction(new IncrementNumberByOneAction());
CommonEditorRegistry.registerEditorAction(new IncrementNumberByTenAction());
CommonEditorRegistry.registerEditorAction(new DecrementNumberByOneTenthAction());
CommonEditorRegistry.registerEditorAction(new DecrementNumberByOneAction());
CommonEditorRegistry.registerEditorAction(new DecrementNumberByTenAction());

View file

@ -21,4 +21,4 @@ class GoToMatchingPairAction extends BasicEmmetEditorAction {
}
}
CommonEditorRegistry.registerEditorAction2(new GoToMatchingPairAction());
CommonEditorRegistry.registerEditorAction(new GoToMatchingPairAction());

View file

@ -21,4 +21,4 @@ class MergeLinesAction extends BasicEmmetEditorAction {
}
}
CommonEditorRegistry.registerEditorAction2(new MergeLinesAction());
CommonEditorRegistry.registerEditorAction(new MergeLinesAction());

View file

@ -21,4 +21,4 @@ class ReflectCSSValueAction extends BasicEmmetEditorAction {
}
}
CommonEditorRegistry.registerEditorAction2(new ReflectCSSValueAction());
CommonEditorRegistry.registerEditorAction(new ReflectCSSValueAction());

View file

@ -21,4 +21,4 @@ class RemoveTagAction extends BasicEmmetEditorAction {
}
}
CommonEditorRegistry.registerEditorAction2(new RemoveTagAction());
CommonEditorRegistry.registerEditorAction(new RemoveTagAction());

View file

@ -32,5 +32,5 @@ class SelectNextItemAction extends BasicEmmetEditorAction {
}
}
CommonEditorRegistry.registerEditorAction2(new SelectPreviousItemAction());
CommonEditorRegistry.registerEditorAction2(new SelectNextItemAction());
CommonEditorRegistry.registerEditorAction(new SelectPreviousItemAction());
CommonEditorRegistry.registerEditorAction(new SelectNextItemAction());

View file

@ -21,4 +21,4 @@ class SplitJoinTagAction extends BasicEmmetEditorAction {
}
}
CommonEditorRegistry.registerEditorAction2(new SplitJoinTagAction());
CommonEditorRegistry.registerEditorAction(new SplitJoinTagAction());

View file

@ -21,4 +21,4 @@ class ToggleCommentAction extends BasicEmmetEditorAction {
}
}
CommonEditorRegistry.registerEditorAction2(new ToggleCommentAction());
CommonEditorRegistry.registerEditorAction(new ToggleCommentAction());

View file

@ -21,4 +21,4 @@ class UpdateImageSizeAction extends BasicEmmetEditorAction {
}
}
CommonEditorRegistry.registerEditorAction2(new UpdateImageSizeAction());
CommonEditorRegistry.registerEditorAction(new UpdateImageSizeAction());

View file

@ -41,4 +41,4 @@ class UpdateTagAction extends EmmetEditorAction {
}
}
CommonEditorRegistry.registerEditorAction2(new UpdateTagAction());
CommonEditorRegistry.registerEditorAction(new UpdateTagAction());

View file

@ -40,4 +40,4 @@ class WrapWithAbbreviationAction extends EmmetEditorAction {
}
}
CommonEditorRegistry.registerEditorAction2(new WrapWithAbbreviationAction());
CommonEditorRegistry.registerEditorAction(new WrapWithAbbreviationAction());

View file

@ -7,7 +7,7 @@
import {TPromise} from 'vs/base/common/winjs.base';
import {ICommonCodeEditor} from 'vs/editor/common/editorCommon';
import {EditorAction2, ServicesAccessor} from 'vs/editor/common/editorCommonExtensions';
import {EditorAction, ServicesAccessor} from 'vs/editor/common/editorCommonExtensions';
import {IInstantiationService} from 'vs/platform/instantiation/common/instantiation';
import {EditorAccessor} from 'vs/workbench/parts/emmet/node/editorAccessor';
@ -97,7 +97,7 @@ export class EmmetActionContext {
}
}
export abstract class EmmetEditorAction extends EditorAction2 {
export abstract class EmmetEditorAction extends EditorAction {
constructor(id:string, label:string, alias:string) {
super(id, label, alias, true);