Adopting EditorAction2
This commit is contained in:
parent
04bed0f847
commit
d17b68b015
|
@ -63,7 +63,7 @@ class ExecCommandCutAction extends ClipboardWritingAction {
|
|||
|
||||
this.kbOpts = {
|
||||
commandHandler: execCommandToHandler.bind(null, this.id, 'cut'),
|
||||
kbExpr: KbExpr.and(EditorKbExpr.Focus, EditorKbExpr.Writable),
|
||||
kbExpr: KbExpr.and(EditorKbExpr.TextFocus, EditorKbExpr.Writable),
|
||||
primary: KeyMod.CtrlCmd | KeyCode.KEY_X,
|
||||
win: { primary: KeyMod.CtrlCmd | KeyCode.KEY_X, secondary: [KeyMod.Shift | KeyCode.Delete] }
|
||||
};
|
||||
|
@ -101,7 +101,7 @@ class ExecCommandCopyAction extends ClipboardWritingAction {
|
|||
|
||||
this.kbOpts = {
|
||||
commandHandler: execCommandToHandler.bind(null, this.id, 'copy'),
|
||||
kbExpr: EditorKbExpr.Focus,
|
||||
kbExpr: EditorKbExpr.TextFocus,
|
||||
primary: KeyMod.CtrlCmd | KeyCode.KEY_C,
|
||||
win: { primary: KeyMod.CtrlCmd | KeyCode.KEY_C, secondary: [KeyMod.CtrlCmd | KeyCode.Insert] }
|
||||
};
|
||||
|
@ -132,7 +132,7 @@ class ExecCommandPasteAction extends EditorAction2 {
|
|||
|
||||
this.kbOpts = {
|
||||
commandHandler: execCommandToHandler.bind(null, this.id, 'paste'),
|
||||
kbExpr: KbExpr.and(EditorKbExpr.Focus, EditorKbExpr.Writable),
|
||||
kbExpr: KbExpr.and(EditorKbExpr.TextFocus, EditorKbExpr.Writable),
|
||||
primary: KeyMod.CtrlCmd | KeyCode.KEY_V,
|
||||
win: { primary: KeyMod.CtrlCmd | KeyCode.KEY_V, secondary: [KeyMod.Shift | KeyCode.Insert] }
|
||||
};
|
||||
|
|
|
@ -7,15 +7,12 @@
|
|||
import * as nls from 'vs/nls';
|
||||
import {KeyCode, KeyMod} from 'vs/base/common/keyCodes';
|
||||
import {Disposable} from 'vs/base/common/lifecycle';
|
||||
import {TPromise} from 'vs/base/common/winjs.base';
|
||||
import {IKeybindingContextKey, IKeybindingService, IKeybindings, KbExpr} from 'vs/platform/keybinding/common/keybinding';
|
||||
import {Range} from 'vs/editor/common/core/range';
|
||||
import {Selection} from 'vs/editor/common/core/selection';
|
||||
import {EditorAction} from 'vs/editor/common/editorAction';
|
||||
import {Behaviour} from 'vs/editor/common/editorActionEnablement';
|
||||
import * as strings from 'vs/base/common/strings';
|
||||
import * as editorCommon from 'vs/editor/common/editorCommon';
|
||||
import {CommonEditorRegistry, ContextKey, EditorActionDescriptor} from 'vs/editor/common/editorCommonExtensions';
|
||||
import {ServicesAccessor, EditorKbExpr, EditorAction2, 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';
|
||||
|
@ -233,31 +230,40 @@ export class CommonFindController extends Disposable implements editorCommon.IEd
|
|||
}
|
||||
}
|
||||
|
||||
export class StartFindAction extends EditorAction {
|
||||
export class StartFindAction extends EditorAction2 {
|
||||
|
||||
constructor(descriptor: editorCommon.IEditorActionDescriptorData, editor: editorCommon.ICommonCodeEditor) {
|
||||
super(descriptor, editor, Behaviour.WidgetFocus);
|
||||
constructor() {
|
||||
super(
|
||||
FIND_IDS.StartFindAction,
|
||||
nls.localize('startFindAction',"Find"),
|
||||
'Find',
|
||||
false
|
||||
);
|
||||
|
||||
this.kbOpts = {
|
||||
kbExpr: null,
|
||||
primary: KeyMod.CtrlCmd | KeyCode.KEY_F
|
||||
};
|
||||
}
|
||||
|
||||
public run(): TPromise<boolean> {
|
||||
let controller = CommonFindController.getFindController(this.editor);
|
||||
public run(accessor:ServicesAccessor, editor:editorCommon.ICommonCodeEditor): void {
|
||||
let controller = CommonFindController.getFindController(editor);
|
||||
controller.start({
|
||||
forceRevealReplace: false,
|
||||
seedSearchStringFromSelection: true,
|
||||
shouldFocus: FindStartFocusAction.FocusFindInput,
|
||||
shouldAnimate: true
|
||||
});
|
||||
return TPromise.as(true);
|
||||
}
|
||||
}
|
||||
|
||||
export abstract class MatchFindAction extends EditorAction {
|
||||
constructor(descriptor:editorCommon.IEditorActionDescriptorData, editor:editorCommon.ICommonCodeEditor) {
|
||||
super(descriptor, editor, Behaviour.WidgetFocus);
|
||||
export abstract class MatchFindAction extends EditorAction2 {
|
||||
constructor(id:string, label:string, alias:string) {
|
||||
super(id, label, alias, false);
|
||||
}
|
||||
|
||||
public run(): TPromise<boolean> {
|
||||
let controller = CommonFindController.getFindController(this.editor);
|
||||
public run(accessor:ServicesAccessor, editor:editorCommon.ICommonCodeEditor): void {
|
||||
let controller = CommonFindController.getFindController(editor);
|
||||
if (!this._run(controller)) {
|
||||
controller.start({
|
||||
forceRevealReplace: false,
|
||||
|
@ -267,31 +273,61 @@ export abstract class MatchFindAction extends EditorAction {
|
|||
});
|
||||
this._run(controller);
|
||||
}
|
||||
return TPromise.as(true);
|
||||
}
|
||||
|
||||
protected abstract _run(controller:CommonFindController): boolean;
|
||||
}
|
||||
|
||||
export class NextMatchFindAction extends MatchFindAction {
|
||||
|
||||
constructor() {
|
||||
super(
|
||||
FIND_IDS.NextMatchFindAction,
|
||||
nls.localize('findNextMatchAction', "Find Next"),
|
||||
'Find Next'
|
||||
);
|
||||
|
||||
this.kbOpts = {
|
||||
kbExpr: EditorKbExpr.Focus,
|
||||
primary: KeyCode.F3,
|
||||
mac: { primary: KeyMod.CtrlCmd | KeyCode.KEY_G, secondary: [KeyCode.F3] }
|
||||
};
|
||||
}
|
||||
|
||||
protected _run(controller:CommonFindController): boolean {
|
||||
return controller.moveToNextMatch();
|
||||
}
|
||||
}
|
||||
|
||||
export class PreviousMatchFindAction extends MatchFindAction {
|
||||
|
||||
constructor() {
|
||||
super(
|
||||
FIND_IDS.PreviousMatchFindAction,
|
||||
nls.localize('findPreviousMatchAction', "Find Previous"),
|
||||
'Find Previous'
|
||||
);
|
||||
|
||||
this.kbOpts = {
|
||||
kbExpr: EditorKbExpr.Focus,
|
||||
primary: KeyMod.Shift | KeyCode.F3,
|
||||
mac: { primary: KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.KEY_G, secondary: [KeyMod.Shift | KeyCode.F3] }
|
||||
};
|
||||
}
|
||||
|
||||
protected _run(controller:CommonFindController): boolean {
|
||||
return controller.moveToPrevMatch();
|
||||
}
|
||||
}
|
||||
|
||||
export abstract class SelectionMatchFindAction extends EditorAction {
|
||||
constructor(descriptor:editorCommon.IEditorActionDescriptorData, editor:editorCommon.ICommonCodeEditor) {
|
||||
super(descriptor, editor, Behaviour.WidgetFocus);
|
||||
export abstract class SelectionMatchFindAction extends EditorAction2 {
|
||||
|
||||
constructor(id:string, label:string, alias:string) {
|
||||
super(id, label, alias, false);
|
||||
}
|
||||
|
||||
public run(): TPromise<boolean> {
|
||||
let controller = CommonFindController.getFindController(this.editor);
|
||||
public run(accessor:ServicesAccessor, editor:editorCommon.ICommonCodeEditor): void {
|
||||
let controller = CommonFindController.getFindController(editor);
|
||||
let selectionSearchString = controller.getSelectionSearchString();
|
||||
if (selectionSearchString) {
|
||||
controller.setSearchString(selectionSearchString);
|
||||
|
@ -305,39 +341,76 @@ export abstract class SelectionMatchFindAction extends EditorAction {
|
|||
});
|
||||
this._run(controller);
|
||||
}
|
||||
return TPromise.as(true);
|
||||
}
|
||||
|
||||
protected abstract _run(controller:CommonFindController): boolean;
|
||||
}
|
||||
|
||||
export class NextSelectionMatchFindAction extends SelectionMatchFindAction {
|
||||
|
||||
constructor() {
|
||||
super(
|
||||
FIND_IDS.NextSelectionMatchFindAction,
|
||||
nls.localize('nextSelectionMatchFindAction', "Find Next Selection"),
|
||||
'Find Next Selection'
|
||||
);
|
||||
|
||||
this.kbOpts = {
|
||||
kbExpr: EditorKbExpr.Focus,
|
||||
primary: KeyMod.CtrlCmd | KeyCode.F3
|
||||
};
|
||||
}
|
||||
|
||||
protected _run(controller:CommonFindController): boolean {
|
||||
return controller.moveToNextMatch();
|
||||
}
|
||||
}
|
||||
|
||||
export class PreviousSelectionMatchFindAction extends SelectionMatchFindAction {
|
||||
|
||||
constructor() {
|
||||
super(
|
||||
FIND_IDS.PreviousSelectionMatchFindAction,
|
||||
nls.localize('previousSelectionMatchFindAction', "Find Previous Selection"),
|
||||
'Find Previous Selection'
|
||||
);
|
||||
|
||||
this.kbOpts = {
|
||||
kbExpr: EditorKbExpr.Focus,
|
||||
primary: KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.F3
|
||||
};
|
||||
}
|
||||
|
||||
protected _run(controller:CommonFindController): boolean {
|
||||
return controller.moveToPrevMatch();
|
||||
}
|
||||
}
|
||||
|
||||
export class StartFindReplaceAction extends EditorAction {
|
||||
export class StartFindReplaceAction extends EditorAction2 {
|
||||
|
||||
constructor(descriptor:editorCommon.IEditorActionDescriptorData, editor:editorCommon.ICommonCodeEditor) {
|
||||
super(descriptor, editor, Behaviour.WidgetFocus | Behaviour.Writeable);
|
||||
constructor() {
|
||||
super(
|
||||
FIND_IDS.StartFindReplaceAction,
|
||||
nls.localize('startReplace', "Replace"),
|
||||
'Replace',
|
||||
true
|
||||
);
|
||||
|
||||
this.kbOpts = {
|
||||
kbExpr: null,
|
||||
primary: KeyMod.CtrlCmd | KeyCode.KEY_H,
|
||||
mac: { primary: KeyMod.CtrlCmd | KeyMod.Alt | KeyCode.KEY_F }
|
||||
};
|
||||
}
|
||||
|
||||
public run(): TPromise<boolean> {
|
||||
let controller = CommonFindController.getFindController(this.editor);
|
||||
public run(accessor:ServicesAccessor, editor:editorCommon.ICommonCodeEditor): void {
|
||||
let controller = CommonFindController.getFindController(editor);
|
||||
controller.start({
|
||||
forceRevealReplace: true,
|
||||
seedSearchStringFromSelection: true,
|
||||
shouldFocus: FindStartFocusAction.FocusReplaceInput,
|
||||
shouldAnimate: true
|
||||
});
|
||||
return TPromise.as(true);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -399,13 +472,14 @@ function multiCursorFind(editor:editorCommon.ICommonCodeEditor, changeFindSearch
|
|||
};
|
||||
}
|
||||
|
||||
export class SelectNextFindMatchAction extends EditorAction {
|
||||
constructor(descriptor:editorCommon.IEditorActionDescriptorData, editor:editorCommon.ICommonCodeEditor) {
|
||||
super(descriptor, editor, Behaviour.WidgetFocus);
|
||||
export abstract class SelectNextFindMatchAction extends EditorAction2 {
|
||||
|
||||
constructor(id:string, label:string, alias:string) {
|
||||
super(id, label, alias, false);
|
||||
}
|
||||
|
||||
protected _getNextMatch(): Selection {
|
||||
let r = multiCursorFind(this.editor, true);
|
||||
protected _getNextMatch(editor:editorCommon.ICommonCodeEditor): Selection {
|
||||
let r = multiCursorFind(editor, true);
|
||||
if (!r) {
|
||||
return null;
|
||||
}
|
||||
|
@ -413,10 +487,10 @@ export class SelectNextFindMatchAction extends EditorAction {
|
|||
return r.currentMatch;
|
||||
}
|
||||
|
||||
let allSelections = this.editor.getSelections();
|
||||
let allSelections = editor.getSelections();
|
||||
let lastAddedSelection = allSelections[allSelections.length - 1];
|
||||
|
||||
let nextMatch = this.editor.getModel().findNextMatch(r.searchText, lastAddedSelection.getEndPosition(), false, r.matchCase, r.wholeWord);
|
||||
let nextMatch = editor.getModel().findNextMatch(r.searchText, lastAddedSelection.getEndPosition(), false, r.matchCase, r.wholeWord);
|
||||
|
||||
if (!nextMatch) {
|
||||
return null;
|
||||
|
@ -426,13 +500,14 @@ export class SelectNextFindMatchAction extends EditorAction {
|
|||
}
|
||||
}
|
||||
|
||||
export class SelectPreviousFindMatchAction extends EditorAction {
|
||||
constructor(descriptor:editorCommon.IEditorActionDescriptorData, editor:editorCommon.ICommonCodeEditor) {
|
||||
super(descriptor, editor, Behaviour.WidgetFocus);
|
||||
export abstract class SelectPreviousFindMatchAction extends EditorAction2 {
|
||||
|
||||
constructor(id:string, label:string, alias:string) {
|
||||
super(id, label, alias, false);
|
||||
}
|
||||
|
||||
protected _getPreviousMatch(): Selection {
|
||||
let r = multiCursorFind(this.editor, true);
|
||||
protected _getPreviousMatch(editor:editorCommon.ICommonCodeEditor): Selection {
|
||||
let r = multiCursorFind(editor, true);
|
||||
if (!r) {
|
||||
return null;
|
||||
}
|
||||
|
@ -440,10 +515,10 @@ export class SelectPreviousFindMatchAction extends EditorAction {
|
|||
return r.currentMatch;
|
||||
}
|
||||
|
||||
let allSelections = this.editor.getSelections();
|
||||
let allSelections = editor.getSelections();
|
||||
let lastAddedSelection = allSelections[allSelections.length - 1];
|
||||
|
||||
let previousMatch = this.editor.getModel().findPreviousMatch(r.searchText, lastAddedSelection.getStartPosition(), false, r.matchCase, r.wholeWord);
|
||||
let previousMatch = editor.getModel().findPreviousMatch(r.searchText, lastAddedSelection.getStartPosition(), false, r.matchCase, r.wholeWord);
|
||||
|
||||
if (!previousMatch) {
|
||||
return null;
|
||||
|
@ -454,112 +529,125 @@ export class SelectPreviousFindMatchAction extends EditorAction {
|
|||
}
|
||||
|
||||
export class AddSelectionToNextFindMatchAction extends SelectNextFindMatchAction {
|
||||
static ID = FIND_IDS.AddSelectionToNextFindMatchAction;
|
||||
|
||||
constructor(descriptor:editorCommon.IEditorActionDescriptorData, editor:editorCommon.ICommonCodeEditor) {
|
||||
super(descriptor, editor);
|
||||
constructor() {
|
||||
super(
|
||||
FIND_IDS.AddSelectionToNextFindMatchAction,
|
||||
nls.localize('addSelectionToNextFindMatch', "Add Selection To Next Find Match"),
|
||||
'Add Selection To Next Find Match'
|
||||
);
|
||||
|
||||
this.kbOpts = {
|
||||
kbExpr: EditorKbExpr.Focus,
|
||||
primary: KeyMod.CtrlCmd | KeyCode.KEY_D
|
||||
};
|
||||
}
|
||||
|
||||
public run(): TPromise<boolean> {
|
||||
let nextMatch = this._getNextMatch();
|
||||
public run(accessor:ServicesAccessor, editor:editorCommon.ICommonCodeEditor): void {
|
||||
let nextMatch = this._getNextMatch(editor);
|
||||
|
||||
if (!nextMatch) {
|
||||
return TPromise.as(false);
|
||||
return;
|
||||
}
|
||||
|
||||
let allSelections = this.editor.getSelections();
|
||||
this.editor.setSelections(allSelections.concat(nextMatch));
|
||||
this.editor.revealRangeInCenterIfOutsideViewport(nextMatch);
|
||||
|
||||
return TPromise.as(true);
|
||||
let allSelections = editor.getSelections();
|
||||
editor.setSelections(allSelections.concat(nextMatch));
|
||||
editor.revealRangeInCenterIfOutsideViewport(nextMatch);
|
||||
}
|
||||
}
|
||||
|
||||
export class AddSelectionToPreviousFindMatchAction extends SelectPreviousFindMatchAction {
|
||||
static ID = FIND_IDS.AddSelectionToPreviousFindMatchAction;
|
||||
|
||||
constructor(descriptor:editorCommon.IEditorActionDescriptorData, editor:editorCommon.ICommonCodeEditor) {
|
||||
super(descriptor, editor);
|
||||
constructor() {
|
||||
super(
|
||||
FIND_IDS.AddSelectionToPreviousFindMatchAction,
|
||||
nls.localize('addSelectionToPreviousFindMatch', "Add Selection To Previous Find Match"),
|
||||
'Add Selection To Previous Find Match'
|
||||
);
|
||||
}
|
||||
|
||||
public run(): TPromise<boolean> {
|
||||
let previousMatch = this._getPreviousMatch();
|
||||
public run(accessor:ServicesAccessor, editor:editorCommon.ICommonCodeEditor): void {
|
||||
let previousMatch = this._getPreviousMatch(editor);
|
||||
|
||||
if (!previousMatch) {
|
||||
return TPromise.as(false);
|
||||
return;
|
||||
}
|
||||
|
||||
let allSelections = this.editor.getSelections();
|
||||
this.editor.setSelections(allSelections.concat(previousMatch));
|
||||
this.editor.revealRangeInCenterIfOutsideViewport(previousMatch);
|
||||
|
||||
return TPromise.as(true);
|
||||
let allSelections = editor.getSelections();
|
||||
editor.setSelections(allSelections.concat(previousMatch));
|
||||
editor.revealRangeInCenterIfOutsideViewport(previousMatch);
|
||||
}
|
||||
}
|
||||
|
||||
export class MoveSelectionToNextFindMatchAction extends SelectNextFindMatchAction {
|
||||
static ID = FIND_IDS.MoveSelectionToNextFindMatchAction;
|
||||
|
||||
constructor(descriptor:editorCommon.IEditorActionDescriptorData, editor:editorCommon.ICommonCodeEditor) {
|
||||
super(descriptor, editor);
|
||||
constructor() {
|
||||
super(
|
||||
FIND_IDS.MoveSelectionToNextFindMatchAction,
|
||||
nls.localize('moveSelectionToNextFindMatch', "Move Last Selection To Next Find Match"),
|
||||
'Move Last Selection To Next Find Match'
|
||||
);
|
||||
|
||||
this.kbOpts = {
|
||||
kbExpr: EditorKbExpr.Focus,
|
||||
primary: KeyMod.chord(KeyMod.CtrlCmd | KeyCode.KEY_K, KeyMod.CtrlCmd | KeyCode.KEY_D)
|
||||
};
|
||||
}
|
||||
|
||||
public run(): TPromise<boolean> {
|
||||
let nextMatch = this._getNextMatch();
|
||||
public run(accessor:ServicesAccessor, editor:editorCommon.ICommonCodeEditor): void {
|
||||
let nextMatch = this._getNextMatch(editor);
|
||||
|
||||
if (!nextMatch) {
|
||||
return TPromise.as(false);
|
||||
return;
|
||||
}
|
||||
|
||||
let allSelections = this.editor.getSelections();
|
||||
this.editor.setSelections(allSelections.slice(0, allSelections.length - 1).concat(nextMatch));
|
||||
this.editor.revealRangeInCenterIfOutsideViewport(nextMatch);
|
||||
|
||||
return TPromise.as(true);
|
||||
let allSelections = editor.getSelections();
|
||||
editor.setSelections(allSelections.slice(0, allSelections.length - 1).concat(nextMatch));
|
||||
editor.revealRangeInCenterIfOutsideViewport(nextMatch);
|
||||
}
|
||||
}
|
||||
|
||||
export class MoveSelectionToPreviousFindMatchAction extends SelectPreviousFindMatchAction {
|
||||
|
||||
static ID = FIND_IDS.MoveSelectionToPreviousFindMatchAction;
|
||||
|
||||
constructor(descriptor:editorCommon.IEditorActionDescriptorData, editor:editorCommon.ICommonCodeEditor) {
|
||||
super(descriptor, editor);
|
||||
constructor() {
|
||||
super(
|
||||
FIND_IDS.MoveSelectionToPreviousFindMatchAction,
|
||||
nls.localize('moveSelectionToPreviousFindMatch', "Move Last Selection To Previous Find Match"),
|
||||
'Move Last Selection To Previous Find Match'
|
||||
);
|
||||
}
|
||||
|
||||
public run(): TPromise<boolean> {
|
||||
let previousMatch = this._getPreviousMatch();
|
||||
public run(accessor:ServicesAccessor, editor:editorCommon.ICommonCodeEditor): void {
|
||||
let previousMatch = this._getPreviousMatch(editor);
|
||||
|
||||
if (!previousMatch) {
|
||||
return TPromise.as(false);
|
||||
return;
|
||||
}
|
||||
|
||||
let allSelections = this.editor.getSelections();
|
||||
this.editor.setSelections(allSelections.slice(0, allSelections.length - 1).concat(previousMatch));
|
||||
this.editor.revealRangeInCenterIfOutsideViewport(previousMatch);
|
||||
|
||||
return TPromise.as(true);
|
||||
let allSelections = editor.getSelections();
|
||||
editor.setSelections(allSelections.slice(0, allSelections.length - 1).concat(previousMatch));
|
||||
editor.revealRangeInCenterIfOutsideViewport(previousMatch);
|
||||
}
|
||||
}
|
||||
|
||||
export class SelectHighlightsAction extends EditorAction {
|
||||
static ID = 'editor.action.selectHighlights';
|
||||
static COMPAT_ID = 'editor.action.changeAll';
|
||||
export abstract class AbstractSelectHighlightsAction extends EditorAction2 {
|
||||
|
||||
constructor(descriptor:editorCommon.IEditorActionDescriptorData, editor:editorCommon.ICommonCodeEditor) {
|
||||
let behaviour = Behaviour.WidgetFocus | Behaviour.Writeable;
|
||||
super(descriptor, editor, behaviour);
|
||||
constructor(id:string, label:string, alias:string) {
|
||||
super(id, label, alias, false);
|
||||
}
|
||||
|
||||
public run(): TPromise<boolean> {
|
||||
let r = multiCursorFind(this.editor, true);
|
||||
public run(accessor:ServicesAccessor, editor:editorCommon.ICommonCodeEditor): void {
|
||||
let r = multiCursorFind(editor, true);
|
||||
if (!r) {
|
||||
return TPromise.as(false);
|
||||
return;
|
||||
}
|
||||
|
||||
let matches = this.editor.getModel().findMatches(r.searchText, true, false, r.matchCase, r.wholeWord);
|
||||
let matches = editor.getModel().findMatches(r.searchText, true, false, r.matchCase, r.wholeWord);
|
||||
|
||||
if (matches.length > 0) {
|
||||
let editorSelection = this.editor.getSelection();
|
||||
let editorSelection = editor.getSelection();
|
||||
for (let i = 0, len = matches.length; i < len; i++) {
|
||||
let match = matches[i];
|
||||
let intersection = match.intersectRanges(editorSelection);
|
||||
|
@ -570,9 +658,44 @@ export class SelectHighlightsAction extends EditorAction {
|
|||
break;
|
||||
}
|
||||
}
|
||||
this.editor.setSelections(matches.map(m => new Selection(m.startLineNumber, m.startColumn, m.endLineNumber, m.endColumn)));
|
||||
editor.setSelections(matches.map(m => new Selection(m.startLineNumber, m.startColumn, m.endLineNumber, m.endColumn)));
|
||||
}
|
||||
return TPromise.as(true);
|
||||
}
|
||||
}
|
||||
|
||||
export class SelectHighlightsAction extends AbstractSelectHighlightsAction {
|
||||
constructor() {
|
||||
super(
|
||||
'editor.action.selectHighlights',
|
||||
nls.localize('selectAllOccurencesOfFindMatch', "Select All Occurences of Find Match"),
|
||||
'Select All Occurences of Find Match'
|
||||
);
|
||||
|
||||
this.kbOpts = {
|
||||
kbExpr: EditorKbExpr.Focus,
|
||||
primary: KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.KEY_L
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
export class CompatChangeAll extends AbstractSelectHighlightsAction {
|
||||
constructor() {
|
||||
super(
|
||||
'editor.action.changeAll',
|
||||
nls.localize('changeAll.label', "Change All Occurrences"),
|
||||
'Change All Occurrences'
|
||||
);
|
||||
|
||||
this.kbOpts = {
|
||||
kbExpr: EditorKbExpr.TextFocus,
|
||||
primary: KeyMod.CtrlCmd | KeyCode.F2
|
||||
};
|
||||
|
||||
this.menuOpts = {
|
||||
group: '1_modification',
|
||||
order: 1.2,
|
||||
kbExpr: KbExpr.not(editorCommon.KEYBINDING_CONTEXT_EDITOR_READONLY)
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -733,72 +856,22 @@ export class SelectionHighlighter extends Disposable implements editorCommon.IEd
|
|||
}
|
||||
|
||||
|
||||
CommonEditorRegistry.registerEditorAction(new EditorActionDescriptor(SelectHighlightsAction, SelectHighlightsAction.ID, nls.localize('selectAllOccurencesOfFindMatch', "Select All Occurences of Find Match"), {
|
||||
context: ContextKey.EditorFocus,
|
||||
primary: KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.KEY_L
|
||||
}, 'Select All Occurences of Find Match'));
|
||||
CommonEditorRegistry.registerEditorAction2(new SelectHighlightsAction());
|
||||
// register SelectHighlightsAction again to replace the now removed Change All action
|
||||
CommonEditorRegistry.registerEditorAction({
|
||||
ctor: SelectHighlightsAction,
|
||||
id: SelectHighlightsAction.COMPAT_ID,
|
||||
label: nls.localize('changeAll.label', "Change All Occurrences"),
|
||||
alias: 'Change All Occurrences',
|
||||
kbOpts: {
|
||||
context: ContextKey.EditorTextFocus,
|
||||
primary: KeyMod.CtrlCmd | KeyCode.F2
|
||||
},
|
||||
menuOpts: {
|
||||
group: '1_modification',
|
||||
order: 1.2,
|
||||
kbExpr: KbExpr.not(editorCommon.KEYBINDING_CONTEXT_EDITOR_READONLY)
|
||||
}
|
||||
});
|
||||
CommonEditorRegistry.registerEditorAction2(new CompatChangeAll());
|
||||
|
||||
// register actions
|
||||
CommonEditorRegistry.registerEditorAction(new EditorActionDescriptor(StartFindAction, FIND_IDS.StartFindAction, nls.localize('startFindAction',"Find"), {
|
||||
context: ContextKey.None,
|
||||
primary: KeyMod.CtrlCmd | KeyCode.KEY_F
|
||||
}, 'Find'));
|
||||
CommonEditorRegistry.registerEditorAction(new EditorActionDescriptor(NextMatchFindAction, FIND_IDS.NextMatchFindAction, nls.localize('findNextMatchAction', "Find Next"), {
|
||||
context: ContextKey.EditorFocus,
|
||||
primary: KeyCode.F3,
|
||||
mac: { primary: KeyMod.CtrlCmd | KeyCode.KEY_G, secondary: [KeyCode.F3] }
|
||||
}, 'Find Next'));
|
||||
CommonEditorRegistry.registerEditorAction(new EditorActionDescriptor(PreviousMatchFindAction, FIND_IDS.PreviousMatchFindAction, nls.localize('findPreviousMatchAction', "Find Previous"), {
|
||||
context: ContextKey.EditorFocus,
|
||||
primary: KeyMod.Shift | KeyCode.F3,
|
||||
mac: { primary: KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.KEY_G, secondary: [KeyMod.Shift | KeyCode.F3] }
|
||||
}, 'Find Previous'));
|
||||
CommonEditorRegistry.registerEditorAction(new EditorActionDescriptor(NextSelectionMatchFindAction, FIND_IDS.NextSelectionMatchFindAction, nls.localize('nextSelectionMatchFindAction', "Find Next Selection"), {
|
||||
context: ContextKey.EditorFocus,
|
||||
primary: KeyMod.CtrlCmd | KeyCode.F3
|
||||
}, 'Find Next Selection'));
|
||||
CommonEditorRegistry.registerEditorAction(new EditorActionDescriptor(PreviousSelectionMatchFindAction, FIND_IDS.PreviousSelectionMatchFindAction, nls.localize('previousSelectionMatchFindAction', "Find Previous Selection"), {
|
||||
context: ContextKey.EditorFocus,
|
||||
primary: KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.F3
|
||||
}, 'Find Previous Selection'));
|
||||
CommonEditorRegistry.registerEditorAction(new EditorActionDescriptor(StartFindReplaceAction, FIND_IDS.StartFindReplaceAction, nls.localize('startReplace', "Replace"), {
|
||||
context: ContextKey.None,
|
||||
primary: KeyMod.CtrlCmd | KeyCode.KEY_H,
|
||||
mac: { primary: KeyMod.CtrlCmd | KeyMod.Alt | KeyCode.KEY_F }
|
||||
}, 'Replace'));
|
||||
CommonEditorRegistry.registerEditorAction(new EditorActionDescriptor(MoveSelectionToNextFindMatchAction, MoveSelectionToNextFindMatchAction.ID, nls.localize('moveSelectionToNextFindMatch', "Move Last Selection To Next Find Match"), {
|
||||
context: ContextKey.EditorFocus,
|
||||
primary: KeyMod.chord(KeyMod.CtrlCmd | KeyCode.KEY_K, KeyMod.CtrlCmd | KeyCode.KEY_D)
|
||||
}, 'Move Last Selection To Next Find Match'));
|
||||
CommonEditorRegistry.registerEditorAction(new EditorActionDescriptor(MoveSelectionToPreviousFindMatchAction, MoveSelectionToPreviousFindMatchAction.ID, nls.localize('moveSelectionToPreviousFindMatch', "Move Last Selection To Previous Find Match"), {
|
||||
context: ContextKey.EditorFocus,
|
||||
primary: 0
|
||||
}, 'Move Last Selection To Previous Find Match'));
|
||||
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 EditorActionDescriptor(AddSelectionToNextFindMatchAction, AddSelectionToNextFindMatchAction.ID, nls.localize('addSelectionToNextFindMatch', "Add Selection To Next Find Match"), {
|
||||
context: ContextKey.EditorFocus,
|
||||
primary: KeyMod.CtrlCmd | KeyCode.KEY_D
|
||||
}, 'Add Selection To Next Find Match'));
|
||||
CommonEditorRegistry.registerEditorAction(new EditorActionDescriptor(AddSelectionToPreviousFindMatchAction, AddSelectionToPreviousFindMatchAction.ID, nls.localize('addSelectionToPreviousFindMatch', "Add Selection To Previous Find Match"), {
|
||||
context: ContextKey.EditorFocus,
|
||||
primary: 0
|
||||
}, 'Add Selection To Previous Find Match'));
|
||||
CommonEditorRegistry.registerEditorAction2(new AddSelectionToNextFindMatchAction());
|
||||
CommonEditorRegistry.registerEditorAction2(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) => {
|
||||
|
|
|
@ -46,11 +46,11 @@ suite('FindController', () => {
|
|||
// The cursor is at the very top, of the file, at the first ABC
|
||||
let findController = editor.registerAndInstantiateContribution<TestFindController>(TestFindController);
|
||||
let findState = findController.getState();
|
||||
let startFindAction = new StartFindAction({id:'',label:''}, editor);
|
||||
let nextMatchFindAction = new NextMatchFindAction({id:'',label:''}, editor);
|
||||
let startFindAction = new StartFindAction();
|
||||
let nextMatchFindAction = new NextMatchFindAction();
|
||||
|
||||
// I hit Ctrl+F to show the Find dialog
|
||||
startFindAction.run();
|
||||
startFindAction.run(null, editor);
|
||||
|
||||
// I type ABC.
|
||||
findState.change({ searchString: 'A' }, true);
|
||||
|
@ -84,14 +84,12 @@ suite('FindController', () => {
|
|||
assert.deepEqual(fromRange(editor.getSelection()), [1, 4, 1, 4]);
|
||||
|
||||
// I hit F3 to "Find Next" to find the next occurrence of ABC, but instead it searches for XYZ.
|
||||
nextMatchFindAction.run();
|
||||
nextMatchFindAction.run(null, editor);
|
||||
|
||||
assert.equal(findState.searchString, 'ABC');
|
||||
assert.equal(findController.hasFocus, false);
|
||||
|
||||
findController.dispose();
|
||||
startFindAction.dispose();
|
||||
nextMatchFindAction.dispose();
|
||||
});
|
||||
});
|
||||
|
||||
|
@ -101,21 +99,20 @@ suite('FindController', () => {
|
|||
], {}, (editor, cursor) => {
|
||||
|
||||
let findController = editor.registerAndInstantiateContribution<TestFindController>(TestFindController);
|
||||
let nextMatchFindAction = new NextMatchFindAction({id:'',label:''}, editor);
|
||||
let nextMatchFindAction = new NextMatchFindAction();
|
||||
|
||||
editor.setPosition({
|
||||
lineNumber: 1,
|
||||
column: 9
|
||||
});
|
||||
|
||||
nextMatchFindAction.run();
|
||||
nextMatchFindAction.run(null, editor);
|
||||
assert.deepEqual(fromRange(editor.getSelection()), [1, 26, 1, 29]);
|
||||
|
||||
nextMatchFindAction.run();
|
||||
nextMatchFindAction.run(null, editor);
|
||||
assert.deepEqual(fromRange(editor.getSelection()), [1, 8, 1, 11]);
|
||||
|
||||
findController.dispose();
|
||||
nextMatchFindAction.dispose();
|
||||
});
|
||||
});
|
||||
|
||||
|
@ -127,23 +124,21 @@ suite('FindController', () => {
|
|||
], {}, (editor, cursor) => {
|
||||
|
||||
let findController = editor.registerAndInstantiateContribution<TestFindController>(TestFindController);
|
||||
let startFindAction = new StartFindAction({id:'',label:''}, editor);
|
||||
let nextMatchFindAction = new NextMatchFindAction({id:'',label:''}, editor);
|
||||
let startFindAction = new StartFindAction();
|
||||
let nextMatchFindAction = new NextMatchFindAction();
|
||||
|
||||
editor.setSelection(new Selection(1, 9, 1, 13));
|
||||
|
||||
findController.toggleRegex();
|
||||
startFindAction.run();
|
||||
startFindAction.run(null, editor);
|
||||
|
||||
nextMatchFindAction.run();
|
||||
nextMatchFindAction.run(null, editor);
|
||||
assert.deepEqual(fromRange(editor.getSelection()), [2, 9, 2, 13]);
|
||||
|
||||
nextMatchFindAction.run();
|
||||
nextMatchFindAction.run(null, editor);
|
||||
assert.deepEqual(fromRange(editor.getSelection()), [1, 9, 1, 13]);
|
||||
|
||||
findController.dispose();
|
||||
startFindAction.dispose();
|
||||
nextMatchFindAction.dispose();
|
||||
});
|
||||
});
|
||||
|
||||
|
@ -155,11 +150,11 @@ suite('FindController', () => {
|
|||
], {}, (editor, cursor) => {
|
||||
|
||||
let findController = editor.registerAndInstantiateContribution<TestFindController>(TestFindController);
|
||||
let selectHighlightsAction = new SelectHighlightsAction({id:'',label:''}, editor);
|
||||
let selectHighlightsAction = new SelectHighlightsAction();
|
||||
|
||||
editor.setSelection(new Selection(2, 9, 2, 16));
|
||||
|
||||
selectHighlightsAction.run();
|
||||
selectHighlightsAction.run(null, editor);
|
||||
assert.deepEqual(editor.getSelections().map(fromRange), [
|
||||
[2, 9, 2, 16],
|
||||
[1, 9, 1, 16],
|
||||
|
@ -171,7 +166,6 @@ suite('FindController', () => {
|
|||
assert.deepEqual(fromRange(editor.getSelection()), [2, 9, 2, 16]);
|
||||
|
||||
findController.dispose();
|
||||
selectHighlightsAction.dispose();
|
||||
});
|
||||
});
|
||||
|
||||
|
|
|
@ -5,15 +5,12 @@
|
|||
'use strict';
|
||||
|
||||
import * as nls from 'vs/nls';
|
||||
import { onUnexpectedError } from 'vs/base/common/errors';
|
||||
import { KeyCode, KeyMod } from 'vs/base/common/keyCodes';
|
||||
import { IDisposable, dispose } from 'vs/base/common/lifecycle';
|
||||
import { TPromise } from 'vs/base/common/winjs.base';
|
||||
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
|
||||
import { KbExpr } from 'vs/platform/keybinding/common/keybinding';
|
||||
import { EditorAction } from 'vs/editor/common/editorAction';
|
||||
import { ICommonCodeEditor, IEditorActionDescriptorData, IEditorContribution, KEYBINDING_CONTEXT_EDITOR_TEXT_FOCUS } from 'vs/editor/common/editorCommon';
|
||||
import { CommonEditorRegistry, ContextKey, EditorActionDescriptor } from 'vs/editor/common/editorCommonExtensions';
|
||||
import { ICommonCodeEditor, IEditorContribution, KEYBINDING_CONTEXT_EDITOR_TEXT_FOCUS } from 'vs/editor/common/editorCommon';
|
||||
import { ServicesAccessor, EditorKbExpr, EditorAction2, 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';
|
||||
|
@ -119,16 +116,14 @@ export class SuggestController implements IEditorContribution {
|
|||
|
||||
Object.keys(triggerCharacters).forEach(ch => {
|
||||
this.triggerCharacterListeners.push(this.editor.addTypingListener(ch, () => {
|
||||
this.triggerSuggest(ch, triggerCharacters[ch]).done(null, onUnexpectedError);
|
||||
this.triggerSuggest(ch, triggerCharacters[ch]);
|
||||
}));
|
||||
});
|
||||
}
|
||||
|
||||
triggerSuggest(triggerCharacter?: string, groups?: ISuggestSupport[][]): TPromise<boolean> {
|
||||
triggerSuggest(triggerCharacter?: string, groups?: ISuggestSupport[][]): void {
|
||||
this.model.trigger(false, triggerCharacter, false, groups);
|
||||
this.editor.focus();
|
||||
|
||||
return TPromise.as(false);
|
||||
}
|
||||
|
||||
acceptSelectedSuggestion(): void {
|
||||
|
@ -174,34 +169,38 @@ export class SuggestController implements IEditorContribution {
|
|||
}
|
||||
}
|
||||
|
||||
export class TriggerSuggestAction extends EditorAction {
|
||||
export class TriggerSuggestAction extends EditorAction2 {
|
||||
|
||||
static ID: string = 'editor.action.triggerSuggest';
|
||||
|
||||
constructor(descriptor: IEditorActionDescriptorData, editor: ICommonCodeEditor) {
|
||||
super(descriptor, editor);
|
||||
constructor() {
|
||||
super(
|
||||
'editor.action.triggerSuggest',
|
||||
nls.localize('suggest.trigger.label', "Trigger Suggest"),
|
||||
'Trigger Suggest',
|
||||
true
|
||||
);
|
||||
|
||||
this.kbOpts = {
|
||||
kbExpr: EditorKbExpr.TextFocus,
|
||||
primary: KeyMod.CtrlCmd | KeyCode.Space,
|
||||
mac: { primary: KeyMod.WinCtrl | KeyCode.Space }
|
||||
};
|
||||
}
|
||||
|
||||
isSupported(): boolean {
|
||||
return SuggestRegistry.has(this.editor.getModel()) && !this.editor.getConfiguration().readOnly;
|
||||
public supported(accessor:ServicesAccessor, editor:ICommonCodeEditor): boolean {
|
||||
if (!super.supported(accessor, editor)) {
|
||||
return false;
|
||||
}
|
||||
return SuggestRegistry.has(editor.getModel());
|
||||
}
|
||||
|
||||
run(): TPromise<boolean> {
|
||||
return SuggestController.getController(this.editor).triggerSuggest();
|
||||
public run(accessor:ServicesAccessor, editor:ICommonCodeEditor): void {
|
||||
SuggestController.getController(editor).triggerSuggest();
|
||||
}
|
||||
}
|
||||
|
||||
CommonEditorRegistry.registerEditorAction(new EditorActionDescriptor(
|
||||
TriggerSuggestAction,
|
||||
TriggerSuggestAction.ID,
|
||||
nls.localize('suggest.trigger.label', "Trigger Suggest"),
|
||||
{
|
||||
context: ContextKey.EditorTextFocus,
|
||||
primary: KeyMod.CtrlCmd | KeyCode.Space,
|
||||
mac: { primary: KeyMod.WinCtrl | KeyCode.Space }
|
||||
},
|
||||
'Trigger Suggest'
|
||||
));
|
||||
CommonEditorRegistry.registerEditorAction2(new TriggerSuggestAction());
|
||||
|
||||
const weight = CommonEditorRegistry.commandWeight(90);
|
||||
|
||||
|
|
|
@ -7,12 +7,9 @@
|
|||
import * as nls from 'vs/nls';
|
||||
import {Registry} from 'vs/platform/platform';
|
||||
import {TPromise} from 'vs/base/common/winjs.base';
|
||||
import {EditorAction} from 'vs/editor/common/editorAction';
|
||||
import {Behaviour} from 'vs/editor/common/editorActionEnablement';
|
||||
import {ICommonCodeEditor, IEditorActionDescriptorData} from 'vs/editor/common/editorCommon';
|
||||
import {CommonEditorRegistry, EditorActionDescriptor} from 'vs/editor/common/editorCommonExtensions';
|
||||
import {ICommonCodeEditor} from 'vs/editor/common/editorCommon';
|
||||
import {ServicesAccessor, EditorAction2, CommonEditorRegistry} from 'vs/editor/common/editorCommonExtensions';
|
||||
import {getSnippetController, CodeSnippet} from 'vs/editor/contrib/snippet/common/snippet';
|
||||
import {ICodeEditorService} from 'vs/editor/common/services/codeEditorService';
|
||||
import {IQuickOpenService, IPickOpenEntry} from 'vs/workbench/services/quickopen/common/quickOpenService';
|
||||
import {ISnippetsRegistry, Extensions, ISnippet} from 'vs/editor/common/modes/snippetsRegistry';
|
||||
|
||||
|
@ -20,22 +17,21 @@ interface ISnippetPick extends IPickOpenEntry {
|
|||
snippet: ISnippet;
|
||||
}
|
||||
|
||||
class ShowSnippetsActions extends EditorAction {
|
||||
class ShowSnippetsActions extends EditorAction2 {
|
||||
|
||||
static ID: string = 'editor.action.showSnippets';
|
||||
|
||||
constructor(
|
||||
descriptor: IEditorActionDescriptorData,
|
||||
editor: ICommonCodeEditor,
|
||||
@IQuickOpenService private _quickOpenService: IQuickOpenService,
|
||||
@ICodeEditorService private _editorService: ICodeEditorService
|
||||
) {
|
||||
super(descriptor, editor, Behaviour.Writeable);
|
||||
constructor() {
|
||||
super(
|
||||
'editor.action.showSnippets',
|
||||
nls.localize('snippet.suggestions.label', "Insert Snippet"),
|
||||
'Insert Snippet',
|
||||
true
|
||||
);
|
||||
}
|
||||
|
||||
run(): TPromise<boolean> {
|
||||
const editor = this._editorService.getFocusedCodeEditor();
|
||||
if (!editor || !editor.getModel()) {
|
||||
public run(accessor:ServicesAccessor, editor:ICommonCodeEditor): TPromise<void> {
|
||||
const quickOpenService = accessor.get(IQuickOpenService);
|
||||
|
||||
if (!editor.getModel()) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -49,19 +45,12 @@ class ShowSnippetsActions extends EditorAction {
|
|||
return true;
|
||||
});
|
||||
|
||||
return this._quickOpenService.pick(picks).then(pick => {
|
||||
return quickOpenService.pick(picks).then(pick => {
|
||||
if (pick) {
|
||||
getSnippetController(this.editor).run(new CodeSnippet(pick.snippet.codeSnippet), 0, 0);
|
||||
return true;
|
||||
getSnippetController(editor).run(new CodeSnippet(pick.snippet.codeSnippet), 0, 0);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
CommonEditorRegistry.registerEditorAction(new EditorActionDescriptor(
|
||||
ShowSnippetsActions,
|
||||
ShowSnippetsActions.ID,
|
||||
nls.localize('snippet.suggestions.label', "Insert Snippet"),
|
||||
undefined,
|
||||
'Insert Snippet'
|
||||
));
|
||||
CommonEditorRegistry.registerEditorAction2(new ShowSnippetsActions());
|
||||
|
|
|
@ -6,36 +6,32 @@
|
|||
|
||||
import * as nls from 'vs/nls';
|
||||
import {KeyCode, KeyMod} from 'vs/base/common/keyCodes';
|
||||
import {TPromise} from 'vs/base/common/winjs.base';
|
||||
import {EditorAction} from 'vs/editor/common/editorAction';
|
||||
import {Behaviour} from 'vs/editor/common/editorActionEnablement';
|
||||
import {ICommonCodeEditor, IEditorActionDescriptorData} from 'vs/editor/common/editorCommon';
|
||||
import {CommonEditorRegistry, EditorActionDescriptor} from 'vs/editor/common/editorCommonExtensions';
|
||||
import {ICommonCodeEditor} from 'vs/editor/common/editorCommon';
|
||||
import {ServicesAccessor, EditorAction2, 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 EditorAction {
|
||||
export class ToggleTabFocusModeAction extends EditorAction2 {
|
||||
|
||||
public static ID = 'editor.action.toggleTabFocusMode';
|
||||
|
||||
constructor(descriptor:IEditorActionDescriptorData, editor:ICommonCodeEditor) {
|
||||
super(descriptor, editor, Behaviour.TextFocus);
|
||||
constructor() {
|
||||
super(
|
||||
ToggleTabFocusModeAction.ID,
|
||||
nls.localize('toggle.tabfocusmode', "Toggle Use of Tab Key for Setting Focus"),
|
||||
'Toggle Use of Tab Key for Setting Focus',
|
||||
false
|
||||
);
|
||||
}
|
||||
|
||||
public run():TPromise<boolean> {
|
||||
|
||||
public run(accessor:ServicesAccessor, editor:ICommonCodeEditor): void {
|
||||
let oldValue = TabFocus.getTabFocusMode();
|
||||
TabFocus.setTabFocusMode(!oldValue);
|
||||
|
||||
return TPromise.as(true);
|
||||
}
|
||||
}
|
||||
|
||||
// register actions
|
||||
CommonEditorRegistry.registerEditorAction(new EditorActionDescriptor(ToggleTabFocusModeAction, ToggleTabFocusModeAction.ID, nls.localize('toggle.tabfocusmode', "Toggle Use of Tab Key for Setting Focus"), {
|
||||
primary: null,
|
||||
context: null
|
||||
}, 'Toggle Use of Tab Key for Setting Focus'));
|
||||
CommonEditorRegistry.registerEditorAction2(new ToggleTabFocusModeAction());
|
||||
|
||||
KeybindingsRegistry.registerCommandRule({
|
||||
id: ToggleTabFocusModeAction.ID,
|
||||
|
|
|
@ -6,23 +6,28 @@
|
|||
|
||||
import * as nls from 'vs/nls';
|
||||
import {KeyCode, KeyMod} from 'vs/base/common/keyCodes';
|
||||
import {TPromise} from 'vs/base/common/winjs.base';
|
||||
import {EditorAction} from 'vs/editor/common/editorAction';
|
||||
import {Behaviour} from 'vs/editor/common/editorActionEnablement';
|
||||
import {ICommonCodeEditor, IEditorActionDescriptorData} from 'vs/editor/common/editorCommon';
|
||||
import {CommonEditorRegistry, ContextKey, EditorActionDescriptor} from 'vs/editor/common/editorCommonExtensions';
|
||||
import {ICommonCodeEditor} from 'vs/editor/common/editorCommon';
|
||||
import {ServicesAccessor, EditorKbExpr, EditorAction2, CommonEditorRegistry} from 'vs/editor/common/editorCommonExtensions';
|
||||
|
||||
class ToggleWordWrapAction extends EditorAction {
|
||||
class ToggleWordWrapAction extends EditorAction2 {
|
||||
|
||||
static ID = 'editor.action.toggleWordWrap';
|
||||
constructor() {
|
||||
super(
|
||||
'editor.action.toggleWordWrap',
|
||||
nls.localize('toggle.wordwrap', "View: Toggle Word Wrap"),
|
||||
'View: Toggle Word Wrap',
|
||||
false
|
||||
);
|
||||
|
||||
constructor(descriptor:IEditorActionDescriptorData, editor:ICommonCodeEditor) {
|
||||
super(descriptor, editor, Behaviour.TextFocus);
|
||||
this.kbOpts = {
|
||||
kbExpr: EditorKbExpr.TextFocus,
|
||||
primary: KeyMod.Alt | KeyCode.KEY_Z
|
||||
};
|
||||
}
|
||||
|
||||
public run():TPromise<boolean> {
|
||||
public run(accessor:ServicesAccessor, editor:ICommonCodeEditor): void {
|
||||
|
||||
let wrappingInfo = this.editor.getConfiguration().wrappingInfo;
|
||||
let wrappingInfo = editor.getConfiguration().wrappingInfo;
|
||||
|
||||
let newWrappingColumn: number;
|
||||
if (!wrappingInfo.isViewportWrapping) {
|
||||
|
@ -31,18 +36,11 @@ class ToggleWordWrapAction extends EditorAction {
|
|||
newWrappingColumn = -1;
|
||||
}
|
||||
|
||||
this.editor.updateOptions({
|
||||
editor.updateOptions({
|
||||
wrappingColumn: newWrappingColumn
|
||||
});
|
||||
|
||||
return TPromise.as(true);
|
||||
}
|
||||
}
|
||||
|
||||
// register actions
|
||||
CommonEditorRegistry.registerEditorAction(new EditorActionDescriptor(ToggleWordWrapAction, ToggleWordWrapAction.ID, nls.localize('toggle.wordwrap', "View: Toggle Word Wrap"), {
|
||||
context: ContextKey.EditorTextFocus,
|
||||
primary: KeyMod.Alt | KeyCode.KEY_Z,
|
||||
mac: { primary: KeyMod.Alt | KeyCode.KEY_Z },
|
||||
linux: { primary: KeyMod.Alt | KeyCode.KEY_Z }
|
||||
}, 'View: Toggle Word Wrap'));
|
||||
CommonEditorRegistry.registerEditorAction2(new ToggleWordWrapAction());
|
||||
|
|
|
@ -10,9 +10,7 @@ import {TPromise} from 'vs/base/common/winjs.base';
|
|||
import {Range} from 'vs/editor/common/core/range';
|
||||
import editorCommon = require('vs/editor/common/editorCommon');
|
||||
import editorbrowser = require('vs/editor/browser/editorBrowser');
|
||||
import {EditorAction} from 'vs/editor/common/editorAction';
|
||||
import {Behaviour} from 'vs/editor/common/editorActionEnablement';
|
||||
import {IKeybindingService} from 'vs/platform/keybinding/common/keybinding';
|
||||
import {KbExpr, IKeybindingService} from 'vs/platform/keybinding/common/keybinding';
|
||||
import {ICommandService} from 'vs/platform/commands/common/commands';
|
||||
import debug = require('vs/workbench/parts/debug/common/debug');
|
||||
import model = require('vs/workbench/parts/debug/common/debugModel');
|
||||
|
@ -20,6 +18,8 @@ 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 {KeyMod, KeyCode} from 'vs/base/common/keyCodes';
|
||||
import IDebugService = debug.IDebugService;
|
||||
|
||||
export class AbstractDebugAction extends actions.Action {
|
||||
|
@ -516,45 +516,55 @@ export class EditConditionalBreakpointAction extends AbstractDebugAction {
|
|||
}
|
||||
}
|
||||
|
||||
export class ToggleBreakpointAction extends EditorAction {
|
||||
static ID = 'editor.debug.action.toggleBreakpoint';
|
||||
export class ToggleBreakpointAction extends EditorAction2 {
|
||||
constructor() {
|
||||
super(
|
||||
'editor.debug.action.toggleBreakpoint',
|
||||
nls.localize('toggleBreakpointAction', "Debug: Toggle Breakpoint"),
|
||||
'Debug: Toggle Breakpoint',
|
||||
false
|
||||
);
|
||||
|
||||
constructor(descriptor: editorCommon.IEditorActionDescriptorData, editor: editorCommon.ICommonCodeEditor, @IDebugService private debugService: IDebugService) {
|
||||
super(descriptor, editor, Behaviour.TextFocus);
|
||||
this.kbOpts = {
|
||||
kbExpr: EditorKbExpr.TextFocus,
|
||||
primary: KeyCode.F9
|
||||
};
|
||||
}
|
||||
|
||||
public run(): TPromise<any> {
|
||||
const lineNumber = this.editor.getPosition().lineNumber;
|
||||
const modelUrl = this.editor.getModel().uri;
|
||||
if (this.debugService.getConfigurationManager().canSetBreakpointsIn(this.editor.getModel())) {
|
||||
const bp = this.debugService.getModel().getBreakpoints()
|
||||
public run(accessor:ServicesAccessor, editor:editorCommon.ICommonCodeEditor): TPromise<void> {
|
||||
const debugService = accessor.get(IDebugService);
|
||||
|
||||
const lineNumber = editor.getPosition().lineNumber;
|
||||
const modelUrl = editor.getModel().uri;
|
||||
if (debugService.getConfigurationManager().canSetBreakpointsIn(editor.getModel())) {
|
||||
const bp = debugService.getModel().getBreakpoints()
|
||||
.filter(bp => bp.lineNumber === lineNumber && bp.source.uri.toString() === modelUrl.toString()).pop();
|
||||
|
||||
return bp ? this.debugService.removeBreakpoints(bp.getId())
|
||||
: this.debugService.addBreakpoints([{ uri: modelUrl, lineNumber: lineNumber }]);
|
||||
return bp ? debugService.removeBreakpoints(bp.getId())
|
||||
: debugService.addBreakpoints([{ uri: modelUrl, lineNumber: lineNumber }]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export class EditorConditionalBreakpointAction extends EditorAction {
|
||||
static ID = 'editor.debug.action.conditionalBreakpoint';
|
||||
export class EditorConditionalBreakpointAction extends EditorAction2 {
|
||||
|
||||
constructor(
|
||||
descriptor: editorCommon.IEditorActionDescriptorData,
|
||||
editor: editorCommon.ICommonCodeEditor,
|
||||
@IDebugService private debugService: IDebugService,
|
||||
@IInstantiationService private instantiationService: IInstantiationService
|
||||
) {
|
||||
super(descriptor, editor, Behaviour.TextFocus);
|
||||
constructor() {
|
||||
super(
|
||||
'editor.debug.action.conditionalBreakpoint',
|
||||
nls.localize('conditionalBreakpointEditorAction', "Debug: Conditional Breakpoint"),
|
||||
'Debug: Conditional Breakpoint',
|
||||
false
|
||||
);
|
||||
}
|
||||
|
||||
public run(): TPromise<any> {
|
||||
const lineNumber = this.editor.getPosition().lineNumber;
|
||||
if (this.debugService.getConfigurationManager().canSetBreakpointsIn(this.editor.getModel())) {
|
||||
BreakpointWidget.createInstance(<editorbrowser.ICodeEditor>this.editor, lineNumber, this.instantiationService);
|
||||
}
|
||||
public run(accessor:ServicesAccessor, editor:editorCommon.ICommonCodeEditor): void {
|
||||
const debugService = accessor.get(IDebugService);
|
||||
const instantiationService = accessor.get(IInstantiationService);
|
||||
|
||||
return TPromise.as(null);
|
||||
const lineNumber = editor.getPosition().lineNumber;
|
||||
if (debugService.getConfigurationManager().canSetBreakpointsIn(editor.getModel())) {
|
||||
BreakpointWidget.createInstance(<editorbrowser.ICodeEditor>editor, lineNumber, instantiationService);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -580,42 +590,55 @@ export class SetValueAction extends AbstractDebugAction {
|
|||
}
|
||||
}
|
||||
|
||||
export class RunToCursorAction extends EditorAction {
|
||||
static ID = 'editor.debug.action.runToCursor';
|
||||
export class RunToCursorAction extends EditorAction2 {
|
||||
|
||||
private debugService: IDebugService;
|
||||
constructor() {
|
||||
super(
|
||||
'editor.debug.action.runToCursor',
|
||||
nls.localize('runToCursor', "Debug: Run to Cursor"),
|
||||
'Debug: Run to Cursor',
|
||||
false
|
||||
);
|
||||
|
||||
constructor(descriptor:editorCommon.IEditorActionDescriptorData, editor:editorCommon.ICommonCodeEditor, @IDebugService debugService: IDebugService) {
|
||||
super(descriptor, editor, Behaviour.TextFocus);
|
||||
this.debugService = debugService;
|
||||
this.menuOpts = {
|
||||
kbExpr: KbExpr.has(debug.CONTEXT_IN_DEBUG_MODE),
|
||||
group: 'debug'
|
||||
};
|
||||
}
|
||||
|
||||
public run(): TPromise<void> {
|
||||
if (this.debugService.state !== debug.State.Stopped) {
|
||||
public run(accessor:ServicesAccessor, editor:editorCommon.ICommonCodeEditor): TPromise<void> {
|
||||
const debugService = accessor.get(IDebugService);
|
||||
|
||||
if (debugService.state !== debug.State.Stopped) {
|
||||
return TPromise.as(null);
|
||||
}
|
||||
const lineNumber = this.editor.getPosition().lineNumber;
|
||||
const uri = this.editor.getModel().uri;
|
||||
const lineNumber = editor.getPosition().lineNumber;
|
||||
const uri = editor.getModel().uri;
|
||||
|
||||
const oneTimeListener = this.debugService.getActiveSession().onDidEvent(event => {
|
||||
const oneTimeListener = debugService.getActiveSession().onDidEvent(event => {
|
||||
if (event.event === 'stopped' || event.event === 'exit') {
|
||||
const toRemove = this.debugService.getModel().getBreakpoints()
|
||||
const toRemove = debugService.getModel().getBreakpoints()
|
||||
.filter(bp => bp.desiredLineNumber === lineNumber && bp.source.uri.toString() === uri.toString()).pop();
|
||||
if (toRemove) {
|
||||
this.debugService.removeBreakpoints(toRemove.getId());
|
||||
debugService.removeBreakpoints(toRemove.getId());
|
||||
}
|
||||
oneTimeListener.dispose();
|
||||
}
|
||||
});
|
||||
|
||||
const bpExists = !!(this.debugService.getModel().getBreakpoints().filter(bp => bp.lineNumber === lineNumber && bp.source.uri.toString() === uri.toString()).pop());
|
||||
return (bpExists ? TPromise.as(null) : this.debugService.addBreakpoints([{ uri, lineNumber }])).then(() => {
|
||||
this.debugService.continue(this.debugService.getViewModel().getFocusedThreadId());
|
||||
const bpExists = !!(debugService.getModel().getBreakpoints().filter(bp => bp.lineNumber === lineNumber && bp.source.uri.toString() === uri.toString()).pop());
|
||||
return (bpExists ? TPromise.as(null) : debugService.addBreakpoints([{ uri, lineNumber }])).then(() => {
|
||||
debugService.continue(debugService.getViewModel().getFocusedThreadId());
|
||||
});
|
||||
}
|
||||
|
||||
public isSupported(): boolean {
|
||||
return super.isSupported() && this.debugService.state === debug.State.Stopped;
|
||||
public supported(accessor:ServicesAccessor, editor:editorCommon.ICommonCodeEditor): boolean {
|
||||
if (!super.supported(accessor, editor)) {
|
||||
return false;
|
||||
}
|
||||
const debugService = accessor.get(IDebugService);
|
||||
|
||||
return debugService.state === debug.State.Stopped;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -637,46 +660,69 @@ export class AddWatchExpressionAction extends AbstractDebugAction {
|
|||
}
|
||||
}
|
||||
|
||||
export class SelectionToReplAction extends EditorAction {
|
||||
static ID = 'editor.debug.action.selectionToRepl';
|
||||
export class SelectionToReplAction extends EditorAction2 {
|
||||
|
||||
constructor(
|
||||
descriptor: editorCommon.IEditorActionDescriptorData,
|
||||
editor: editorCommon.ICommonCodeEditor,
|
||||
@IDebugService private debugService: IDebugService,
|
||||
@IPanelService private panelService: IPanelService
|
||||
) {
|
||||
super(descriptor, editor, Behaviour.UpdateOnCursorPositionChange);
|
||||
constructor() {
|
||||
super(
|
||||
'editor.debug.action.selectionToRepl',
|
||||
nls.localize('debugEvaluate', "Debug: Evaluate"),
|
||||
'Debug: Evaluate',
|
||||
false
|
||||
);
|
||||
|
||||
this.menuOpts = {
|
||||
kbExpr: KbExpr.and(KbExpr.has(editorCommon.KEYBINDING_CONTEXT_EDITOR_HAS_NON_EMPTY_SELECTION), KbExpr.has(debug.CONTEXT_IN_DEBUG_MODE)),
|
||||
group: 'debug'
|
||||
};
|
||||
}
|
||||
|
||||
public run(): TPromise<any> {
|
||||
const text = this.editor.getModel().getValueInRange(this.editor.getSelection());
|
||||
return this.debugService.addReplExpression(text)
|
||||
.then(() => this.panelService.openPanel(debug.REPL_ID, true));
|
||||
public run(accessor:ServicesAccessor, editor:editorCommon.ICommonCodeEditor): TPromise<void> {
|
||||
const debugService = accessor.get(IDebugService);
|
||||
const panelService = accessor.get(IPanelService);
|
||||
|
||||
|
||||
const text = editor.getModel().getValueInRange(editor.getSelection());
|
||||
return debugService.addReplExpression(text)
|
||||
.then(() => panelService.openPanel(debug.REPL_ID, true))
|
||||
.then(_ => void 0);
|
||||
}
|
||||
|
||||
public isSupported(): boolean {
|
||||
const selection = this.editor.getSelection();
|
||||
return !!selection && !selection.isEmpty() && this.debugService.state !== debug.State.Disabled && this.debugService.state !== debug.State.Inactive;
|
||||
public supported(accessor:ServicesAccessor, editor:editorCommon.ICommonCodeEditor): boolean {
|
||||
if (!super.supported(accessor, editor)) {
|
||||
return false;
|
||||
}
|
||||
const debugService = accessor.get(IDebugService);
|
||||
|
||||
const selection = editor.getSelection();
|
||||
return !!selection && !selection.isEmpty() && debugService.state !== debug.State.Disabled && debugService.state !== debug.State.Inactive;
|
||||
}
|
||||
}
|
||||
|
||||
export class ShowDebugHoverAction extends EditorAction {
|
||||
static ID = 'editor.debug.action.showDebugHover';
|
||||
export class ShowDebugHoverAction extends EditorAction2 {
|
||||
|
||||
constructor(descriptor: editorCommon.IEditorActionDescriptorData, editor: editorCommon.ICommonCodeEditor) {
|
||||
super(descriptor, editor, Behaviour.TextFocus);
|
||||
constructor() {
|
||||
super(
|
||||
'editor.debug.action.showDebugHover',
|
||||
nls.localize('showDebugHover', "Debug: Show Hover"),
|
||||
'Debug: Show Hover',
|
||||
false
|
||||
);
|
||||
|
||||
this.kbOpts = {
|
||||
kbExpr: KbExpr.and(KbExpr.has(debug.CONTEXT_IN_DEBUG_MODE), KbExpr.has(editorCommon.KEYBINDING_CONTEXT_EDITOR_TEXT_FOCUS)),
|
||||
primary: KeyMod.chord(KeyMod.CtrlCmd | KeyCode.KEY_K, KeyMod.CtrlCmd | KeyCode.KEY_I)
|
||||
};
|
||||
}
|
||||
|
||||
public run(): TPromise<any> {
|
||||
const position = this.editor.getPosition();
|
||||
const word = this.editor.getModel().getWordAtPosition(position);
|
||||
public run(accessor:ServicesAccessor, editor:editorCommon.ICommonCodeEditor): TPromise<void> {
|
||||
const position = editor.getPosition();
|
||||
const word = editor.getModel().getWordAtPosition(position);
|
||||
if (!word) {
|
||||
return TPromise.as(null);
|
||||
}
|
||||
|
||||
const range = new Range(position.lineNumber, position.column, position.lineNumber, word.endColumn);
|
||||
return (<debug.IDebugEditorContribution>this.editor.getContribution(debug.EDITOR_CONTRIBUTION_ID)).showHover(range, word.word, true);
|
||||
return (<debug.IDebugEditorContribution>editor.getContribution(debug.EDITOR_CONTRIBUTION_ID)).showHover(range, word.word, true);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -8,8 +8,7 @@ import 'vs/css!../browser/media/debugHover';
|
|||
import nls = require('vs/nls');
|
||||
import {KeyMod, KeyCode} from 'vs/base/common/keyCodes';
|
||||
import {TPromise} from 'vs/base/common/winjs.base';
|
||||
import editorcommon = require('vs/editor/common/editorCommon');
|
||||
import {CommonEditorRegistry, ContextKey, EditorActionDescriptor, defaultEditorActionKeybindingOptions} from 'vs/editor/common/editorCommonExtensions';
|
||||
import {CommonEditorRegistry} from 'vs/editor/common/editorCommonExtensions';
|
||||
import {EditorBrowserRegistry} from 'vs/editor/browser/editorBrowserExtensions';
|
||||
import {SyncActionDescriptor} from 'vs/platform/actions/common/actions';
|
||||
import platform = require('vs/platform/platform');
|
||||
|
@ -51,38 +50,11 @@ class OpenDebugViewletAction extends viewlet.ToggleViewletAction {
|
|||
}
|
||||
|
||||
EditorBrowserRegistry.registerEditorContribution(DebugEditorContribution);
|
||||
CommonEditorRegistry.registerEditorAction(new EditorActionDescriptor(ToggleBreakpointAction, ToggleBreakpointAction.ID, nls.localize('toggleBreakpointAction', "Debug: Toggle Breakpoint"), {
|
||||
context: ContextKey.EditorTextFocus,
|
||||
primary: KeyCode.F9
|
||||
}, 'Debug: Toggle Breakpoint'));
|
||||
CommonEditorRegistry.registerEditorAction(new EditorActionDescriptor(ShowDebugHoverAction, ShowDebugHoverAction.ID, nls.localize('showDebugHover', "Debug: Show Hover"), {
|
||||
context: ContextKey.EditorTextFocus,
|
||||
kbExpr: KbExpr.and(KbExpr.has(debug.CONTEXT_IN_DEBUG_MODE), KbExpr.has(editorcommon.KEYBINDING_CONTEXT_EDITOR_TEXT_FOCUS)),
|
||||
primary: KeyMod.chord(KeyMod.CtrlCmd | KeyCode.KEY_K, KeyMod.CtrlCmd | KeyCode.KEY_I)
|
||||
}, 'Debug: Show Hover'));
|
||||
CommonEditorRegistry.registerEditorAction(new EditorActionDescriptor(EditorConditionalBreakpointAction, EditorConditionalBreakpointAction.ID, nls.localize('conditionalBreakpointEditorAction', "Debug: Conditional Breakpoint"), void 0, 'Debug: Conditional Breakpoint'));
|
||||
CommonEditorRegistry.registerEditorAction({
|
||||
ctor: SelectionToReplAction,
|
||||
id: SelectionToReplAction.ID,
|
||||
label: nls.localize('debugEvaluate', "Debug: Evaluate"),
|
||||
alias: 'Debug: Evaluate',
|
||||
kbOpts: defaultEditorActionKeybindingOptions,
|
||||
menuOpts: {
|
||||
kbExpr: KbExpr.and(KbExpr.has(editorcommon.KEYBINDING_CONTEXT_EDITOR_HAS_NON_EMPTY_SELECTION), KbExpr.has(debug.CONTEXT_IN_DEBUG_MODE)),
|
||||
group: 'debug'
|
||||
}
|
||||
});
|
||||
CommonEditorRegistry.registerEditorAction({
|
||||
ctor: RunToCursorAction,
|
||||
id: RunToCursorAction.ID,
|
||||
label: nls.localize('runToCursor', "Debug: Run to Cursor"),
|
||||
alias: 'Debug: Run to Cursor',
|
||||
kbOpts: defaultEditorActionKeybindingOptions,
|
||||
menuOpts: {
|
||||
kbExpr: KbExpr.has(debug.CONTEXT_IN_DEBUG_MODE),
|
||||
group: 'debug'
|
||||
}
|
||||
});
|
||||
CommonEditorRegistry.registerEditorAction2(new ToggleBreakpointAction());
|
||||
CommonEditorRegistry.registerEditorAction2(new ShowDebugHoverAction());
|
||||
CommonEditorRegistry.registerEditorAction2(new EditorConditionalBreakpointAction());
|
||||
CommonEditorRegistry.registerEditorAction2(new SelectionToReplAction());
|
||||
CommonEditorRegistry.registerEditorAction2(new RunToCursorAction());
|
||||
|
||||
// register viewlet
|
||||
(<viewlet.ViewletRegistry>platform.Registry.as(viewlet.Extensions.Viewlets)).registerViewlet(new viewlet.ViewletDescriptor(
|
||||
|
|
Loading…
Reference in a new issue