提交 6217946d 编写于 作者: A Alex Dima

Remove usages of @editorAction (#37212)

上级 0ea9de83
......@@ -90,9 +90,6 @@ export class View extends ViewEventHandler {
private overflowGuardContainer: FastDomNode<HTMLElement>;
// Actual mutable state
// @ts-ignore unused property
private _isDisposed: boolean;
private _renderAnimationFrame: IDisposable;
constructor(
......@@ -104,7 +101,6 @@ export class View extends ViewEventHandler {
execCoreEditorCommandFunc: ExecCoreEditorCommandFunc
) {
super();
this._isDisposed = false;
this._cursor = cursor;
this._renderAnimationFrame = null;
this.outgoingEvents = new ViewOutgoingEvents(model);
......@@ -345,7 +341,6 @@ export class View extends ViewEventHandler {
// --- end event handlers
public dispose(): void {
this._isDisposed = true;
if (this._renderAnimationFrame !== null) {
this._renderAnimationFrame.dispose();
this._renderAnimationFrame = null;
......
......@@ -16,8 +16,6 @@ import { editorLineHighlight, editorLineHighlightBorder } from 'vs/editor/common
export class CurrentLineHighlightOverlay extends DynamicViewOverlay {
private _context: ViewContext;
private _lineHeight: number;
// @ts-ignore unused property
private _readOnly: boolean;
private _renderLineHighlight: 'none' | 'gutter' | 'line' | 'all';
private _selectionIsEmpty: boolean;
private _primaryCursorIsInEditableRange: boolean;
......@@ -29,7 +27,6 @@ export class CurrentLineHighlightOverlay extends DynamicViewOverlay {
super();
this._context = context;
this._lineHeight = this._context.configuration.editor.lineHeight;
this._readOnly = this._context.configuration.editor.readOnly;
this._renderLineHighlight = this._context.configuration.editor.viewInfo.renderLineHighlight;
this._selectionIsEmpty = true;
......@@ -53,9 +50,6 @@ export class CurrentLineHighlightOverlay extends DynamicViewOverlay {
if (e.lineHeight) {
this._lineHeight = this._context.configuration.editor.lineHeight;
}
if (e.readOnly) {
this._readOnly = this._context.configuration.editor.readOnly;
}
if (e.viewInfo) {
this._renderLineHighlight = this._context.configuration.editor.viewInfo.renderLineHighlight;
}
......
......@@ -24,7 +24,7 @@ import { editorLineNumbers } from 'vs/editor/common/view/editorColorRegistry';
import { KeyCode, KeyMod } from 'vs/base/common/keyCodes';
import { ActionBar } from 'vs/base/browser/ui/actionbar/actionbar';
import { Action } from 'vs/base/common/actions';
import { editorAction, EditorAction, ServicesAccessor } from 'vs/editor/common/editorCommonExtensions';
import { registerEditorAction, EditorAction, ServicesAccessor } from 'vs/editor/common/editorCommonExtensions';
import { ContextKeyExpr } from 'vs/platform/contextkey/common/contextkey';
import { ICodeEditorService } from 'vs/editor/common/services/codeEditorService';
......@@ -763,8 +763,6 @@ registerThemingParticipant((theme, collector) => {
}
});
@editorAction
// @ts-ignore @editorAction uses the class
class DiffReviewNext extends EditorAction {
constructor() {
super({
......@@ -787,8 +785,6 @@ class DiffReviewNext extends EditorAction {
}
}
@editorAction
// @ts-ignore @editorAction uses the class
class DiffReviewPrev extends EditorAction {
constructor() {
super({
......@@ -822,3 +818,6 @@ function findFocusedDiffEditor(accessor: ServicesAccessor): DiffEditorWidget {
}
return null;
}
registerEditorAction(new DiffReviewNext());
registerEditorAction(new DiffReviewPrev());
......@@ -212,8 +212,8 @@ export abstract class EditorAction extends EditorCommand {
// --- Registration of commands and actions
export function editorAction(ctor: { new(): EditorAction; }): void {
CommonEditorRegistry.registerEditorAction(new ctor());
export function registerEditorAction(editorAction: EditorAction): void {
CommonEditorRegistry.registerEditorAction(editorAction);
}
export function editorCommand(ctor: { new(): EditorCommand }): void {
......
......@@ -13,14 +13,12 @@ import { Position } from 'vs/editor/common/core/position';
import { Selection } from 'vs/editor/common/core/selection';
import { RunOnceScheduler } from 'vs/base/common/async';
import * as editorCommon from 'vs/editor/common/editorCommon';
import { editorAction, commonEditorContribution, ServicesAccessor, EditorAction } from 'vs/editor/common/editorCommonExtensions';
import { registerEditorAction, commonEditorContribution, ServicesAccessor, EditorAction } from 'vs/editor/common/editorCommonExtensions';
import { EditorContextKeys } from 'vs/editor/common/editorContextKeys';
import { registerThemingParticipant } from 'vs/platform/theme/common/themeService';
import { editorBracketMatchBackground, editorBracketMatchBorder } from 'vs/editor/common/view/editorColorRegistry';
import { ModelDecorationOptions } from 'vs/editor/common/model/textModelWithDecorations';
@editorAction
// @ts-ignore @editorAction uses the class
class SelectBracketAction extends EditorAction {
constructor() {
super({
......@@ -227,6 +225,7 @@ export class BracketMatchingController extends Disposable implements editorCommo
}
}
registerEditorAction(new SelectBracketAction());
registerThemingParticipant((theme, collector) => {
let bracketMatchBackground = theme.getColor(editorBracketMatchBackground);
if (bracketMatchBackground) {
......
......@@ -7,7 +7,7 @@
import * as nls from 'vs/nls';
import { ICommand, ICommonCodeEditor } from 'vs/editor/common/editorCommon';
import { EditorContextKeys } from 'vs/editor/common/editorContextKeys';
import { IActionOptions, editorAction, EditorAction, ServicesAccessor } from 'vs/editor/common/editorCommonExtensions';
import { IActionOptions, registerEditorAction, EditorAction, ServicesAccessor } from 'vs/editor/common/editorCommonExtensions';
import { MoveCaretCommand } from './moveCaretCommand';
class MoveCaretAction extends EditorAction {
......@@ -35,8 +35,6 @@ class MoveCaretAction extends EditorAction {
}
}
@editorAction
// @ts-ignore @editorAction uses the class
class MoveCaretLeftAction extends MoveCaretAction {
constructor() {
super(true, {
......@@ -48,8 +46,6 @@ class MoveCaretLeftAction extends MoveCaretAction {
}
}
@editorAction
// @ts-ignore @editorAction uses the class
class MoveCaretRightAction extends MoveCaretAction {
constructor() {
super(false, {
......@@ -60,3 +56,6 @@ class MoveCaretRightAction extends MoveCaretAction {
});
}
}
registerEditorAction(new MoveCaretLeftAction());
registerEditorAction(new MoveCaretRightAction());
......@@ -9,11 +9,9 @@ import { KeyCode, KeyMod } from 'vs/base/common/keyCodes';
import { Range } from 'vs/editor/common/core/range';
import { ICommand, ICommonCodeEditor } from 'vs/editor/common/editorCommon';
import { EditorContextKeys } from 'vs/editor/common/editorContextKeys';
import { editorAction, EditorAction, ServicesAccessor } from 'vs/editor/common/editorCommonExtensions';
import { registerEditorAction, EditorAction, ServicesAccessor } from 'vs/editor/common/editorCommonExtensions';
import { ReplaceCommand } from 'vs/editor/common/commands/replaceCommand';
@editorAction
// @ts-ignore @editorAction uses the class
class TransposeLettersAction extends EditorAction {
constructor() {
......@@ -70,3 +68,5 @@ class TransposeLettersAction extends EditorAction {
}
}
}
registerEditorAction(new TransposeLettersAction());
......@@ -13,7 +13,7 @@ import * as platform from 'vs/base/common/platform';
import { ServicesAccessor } from 'vs/platform/instantiation/common/instantiation';
import { ICodeEditorService } from 'vs/editor/common/services/codeEditorService';
import * as editorCommon from 'vs/editor/common/editorCommon';
import { editorAction, IActionOptions, EditorAction, ICommandKeybindingsOptions } from 'vs/editor/common/editorCommonExtensions';
import { registerEditorAction, IActionOptions, EditorAction, ICommandKeybindingsOptions } from 'vs/editor/common/editorCommonExtensions';
import { CopyOptions } from 'vs/editor/browser/controller/textAreaInput';
import { EditorContextKeys } from 'vs/editor/common/editorContextKeys';
......@@ -30,13 +30,6 @@ const supportsPaste = (platform.isNative || (!browser.isChrome && document.query
type ExecCommand = 'cut' | 'copy' | 'paste';
function conditionalEditorAction(condition: boolean) {
if (!condition) {
return () => { };
}
return editorAction;
}
abstract class ExecCommandAction extends EditorAction {
private browserCommand: ExecCommand;
......@@ -63,8 +56,6 @@ abstract class ExecCommandAction extends EditorAction {
}
}
@conditionalEditorAction(supportsCut)
// @ts-ignore @editorAction uses the class
class ExecCommandCutAction extends ExecCommandAction {
constructor() {
......@@ -102,8 +93,6 @@ class ExecCommandCutAction extends ExecCommandAction {
}
}
@conditionalEditorAction(supportsCopy)
// @ts-ignore @editorAction uses the class
class ExecCommandCopyAction extends ExecCommandAction {
constructor() {
......@@ -142,8 +131,6 @@ class ExecCommandCopyAction extends ExecCommandAction {
}
}
@conditionalEditorAction(supportsPaste)
// @ts-ignore @editorAction uses the class
class ExecCommandPasteAction extends ExecCommandAction {
constructor() {
......@@ -172,8 +159,6 @@ class ExecCommandPasteAction extends ExecCommandAction {
}
}
@conditionalEditorAction(supportsCopyWithSyntaxHighlighting)
// @ts-ignore @editorAction uses the class
class ExecCommandCopyWithSyntaxHighlightingAction extends ExecCommandAction {
constructor() {
......@@ -201,3 +186,16 @@ class ExecCommandCopyWithSyntaxHighlightingAction extends ExecCommandAction {
CopyOptions.forceCopyWithSyntaxHighlighting = false;
}
}
if (supportsCut) {
registerEditorAction(new ExecCommandCutAction());
}
if (supportsCopy) {
registerEditorAction(new ExecCommandCopyAction());
}
if (supportsPaste) {
registerEditorAction(new ExecCommandPasteAction());
}
if (supportsCopyWithSyntaxHighlighting) {
registerEditorAction(new ExecCommandCopyWithSyntaxHighlightingAction());
}
......@@ -8,7 +8,7 @@ import * as nls from 'vs/nls';
import { KeyCode, KeyMod, KeyChord } from 'vs/base/common/keyCodes';
import { ICommand, ICommonCodeEditor } from 'vs/editor/common/editorCommon';
import { EditorContextKeys } from 'vs/editor/common/editorContextKeys';
import { editorAction, IActionOptions, EditorAction, ServicesAccessor } from 'vs/editor/common/editorCommonExtensions';
import { registerEditorAction, IActionOptions, EditorAction, ServicesAccessor } from 'vs/editor/common/editorCommonExtensions';
import { BlockCommentCommand } from './blockCommentCommand';
import { LineCommentCommand, Type } from './lineCommentCommand';
......@@ -42,8 +42,6 @@ abstract class CommentLineAction extends EditorAction {
}
@editorAction
// @ts-ignore @editorAction uses the class
class ToggleCommentLineAction extends CommentLineAction {
constructor() {
super(Type.Toggle, {
......@@ -59,8 +57,6 @@ class ToggleCommentLineAction extends CommentLineAction {
}
}
@editorAction
// @ts-ignore @editorAction uses the class
class AddLineCommentAction extends CommentLineAction {
constructor() {
super(Type.ForceAdd, {
......@@ -76,8 +72,6 @@ class AddLineCommentAction extends CommentLineAction {
}
}
@editorAction
// @ts-ignore @editorAction uses the class
class RemoveLineCommentAction extends CommentLineAction {
constructor() {
super(Type.ForceRemove, {
......@@ -93,8 +87,6 @@ class RemoveLineCommentAction extends CommentLineAction {
}
}
@editorAction
// @ts-ignore @editorAction uses the class
class BlockCommentAction extends EditorAction {
constructor() {
......@@ -124,3 +116,8 @@ class BlockCommentAction extends EditorAction {
editor.pushUndoStop();
}
}
registerEditorAction(new ToggleCommentLineAction());
registerEditorAction(new AddLineCommentAction());
registerEditorAction(new RemoveLineCommentAction());
registerEditorAction(new BlockCommentAction());
......@@ -18,7 +18,7 @@ import { IContextKeyService } from 'vs/platform/contextkey/common/contextkey';
import { IMenuService, MenuId } from 'vs/platform/actions/common/actions';
import { ICommonCodeEditor, IEditorContribution, IScrollEvent, ScrollType } from 'vs/editor/common/editorCommon';
import { EditorContextKeys } from 'vs/editor/common/editorContextKeys';
import { editorAction, ServicesAccessor, EditorAction } from 'vs/editor/common/editorCommonExtensions';
import { registerEditorAction, ServicesAccessor, EditorAction } from 'vs/editor/common/editorCommonExtensions';
import { ICodeEditor, IEditorMouseEvent, MouseTargetType } from 'vs/editor/browser/editorBrowser';
import { editorContribution } from 'vs/editor/browser/editorBrowserExtensions';
......@@ -217,8 +217,6 @@ export class ContextMenuController implements IEditorContribution {
}
}
@editorAction
// @ts-ignore @editorAction uses the class
class ShowContextMenu extends EditorAction {
constructor() {
......@@ -239,3 +237,5 @@ class ShowContextMenu extends EditorAction {
contribution.showContextMenu();
}
}
registerEditorAction(new ShowContextMenu());
......@@ -11,7 +11,7 @@ import { Disposable } from 'vs/base/common/lifecycle';
import { ContextKeyExpr, RawContextKey, IContextKey, IContextKeyService } from 'vs/platform/contextkey/common/contextkey';
import * as strings from 'vs/base/common/strings';
import * as editorCommon from 'vs/editor/common/editorCommon';
import { editorAction, ServicesAccessor, EditorAction, EditorCommand, CommonEditorRegistry } from 'vs/editor/common/editorCommonExtensions';
import { registerEditorAction, ServicesAccessor, EditorAction, EditorCommand, CommonEditorRegistry } from 'vs/editor/common/editorCommonExtensions';
import { FIND_IDS, FindModelBoundToEditorModel, ToggleCaseSensitiveKeybinding, ToggleRegexKeybinding, ToggleWholeWordKeybinding, ToggleSearchScopeKeybinding, ShowPreviousFindTermKeybinding, ShowNextFindTermKeybinding } from 'vs/editor/contrib/find/common/findModel';
import { FindReplaceState, FindReplaceStateChangedEvent, INewFindReplaceState } from 'vs/editor/contrib/find/common/findState';
import { getSelectionSearchString } from 'vs/editor/contrib/find/common/find';
......@@ -303,7 +303,6 @@ export class CommonFindController extends Disposable implements editorCommon.IEd
}
}
@editorAction
export class StartFindAction extends EditorAction {
constructor() {
......@@ -353,7 +352,6 @@ export abstract class MatchFindAction extends EditorAction {
protected abstract _run(controller: CommonFindController): boolean;
}
@editorAction
export class NextMatchFindAction extends MatchFindAction {
constructor() {
......@@ -375,7 +373,6 @@ export class NextMatchFindAction extends MatchFindAction {
}
}
@editorAction
export class PreviousMatchFindAction extends MatchFindAction {
constructor() {
......@@ -421,7 +418,6 @@ export abstract class SelectionMatchFindAction extends EditorAction {
protected abstract _run(controller: CommonFindController): boolean;
}
@editorAction
export class NextSelectionMatchFindAction extends SelectionMatchFindAction {
constructor() {
......@@ -442,7 +438,6 @@ export class NextSelectionMatchFindAction extends SelectionMatchFindAction {
}
}
@editorAction
export class PreviousSelectionMatchFindAction extends SelectionMatchFindAction {
constructor() {
......@@ -463,7 +458,6 @@ export class PreviousSelectionMatchFindAction extends SelectionMatchFindAction {
}
}
@editorAction
export class StartFindReplaceAction extends EditorAction {
constructor() {
......@@ -507,8 +501,6 @@ export class StartFindReplaceAction extends EditorAction {
}
}
@editorAction
export class ShowNextFindTermAction extends MatchFindAction {
constructor() {
......@@ -533,8 +525,7 @@ export class ShowNextFindTermAction extends MatchFindAction {
}
}
@editorAction
export class ShpwPreviousFindTermAction extends MatchFindAction {
export class ShowPreviousFindTermAction extends MatchFindAction {
constructor() {
super({
......@@ -558,6 +549,15 @@ export class ShpwPreviousFindTermAction extends MatchFindAction {
}
}
registerEditorAction(new StartFindAction());
registerEditorAction(new NextMatchFindAction());
registerEditorAction(new PreviousMatchFindAction());
registerEditorAction(new NextSelectionMatchFindAction());
registerEditorAction(new PreviousSelectionMatchFindAction());
registerEditorAction(new StartFindReplaceAction());
registerEditorAction(new ShowNextFindTermAction());
registerEditorAction(new ShowPreviousFindTermAction());
const FindCommand = EditorCommand.bindToContribution<CommonFindController>(CommonFindController.get);
CommonEditorRegistry.registerEditorCommand(new FindCommand({
......@@ -659,4 +659,4 @@ CommonEditorRegistry.registerEditorCommand(new FindCommand({
kbExpr: EditorContextKeys.focus,
primary: KeyMod.Alt | KeyCode.Enter
}
}));
\ No newline at end of file
}));
......@@ -14,7 +14,7 @@ import { KeyCode, KeyMod, KeyChord } from 'vs/base/common/keyCodes';
import { IDisposable, dispose } from 'vs/base/common/lifecycle';
import { TPromise } from 'vs/base/common/winjs.base';
import { ICommonCodeEditor, ScrollType, IModel } from 'vs/editor/common/editorCommon';
import { editorAction, ServicesAccessor, EditorAction, CommonEditorRegistry } from 'vs/editor/common/editorCommonExtensions';
import { registerEditorAction, ServicesAccessor, EditorAction, CommonEditorRegistry } from 'vs/editor/common/editorCommonExtensions';
import { ICodeEditor, IEditorMouseEvent, MouseTargetType } from 'vs/editor/browser/editorBrowser';
import { editorContribution } from 'vs/editor/browser/editorBrowserExtensions';
import { FoldingModel, setCollapseStateAtLevel, CollapseMemento, setCollapseStateLevelsDown, setCollapseStateLevelsUp } from 'vs/editor/contrib/folding/common/foldingModel';
......@@ -362,8 +362,6 @@ function foldingArgumentsConstraint(args: any) {
return true;
}
@editorAction
// @ts-ignore @editorAction uses the class
class UnfoldAction extends FoldingAction<FoldingArguments> {
constructor() {
......@@ -407,8 +405,6 @@ class UnfoldAction extends FoldingAction<FoldingArguments> {
}
}
@editorAction
// @ts-ignore @editorAction uses the class
class UnFoldRecursivelyAction extends FoldingAction<void> {
constructor() {
......@@ -429,8 +425,6 @@ class UnFoldRecursivelyAction extends FoldingAction<void> {
}
}
@editorAction
// @ts-ignore @editorAction uses the class
class FoldAction extends FoldingAction<FoldingArguments> {
constructor() {
......@@ -474,8 +468,6 @@ class FoldAction extends FoldingAction<FoldingArguments> {
}
}
@editorAction
// @ts-ignore @editorAction uses the class
class FoldRecursivelyAction extends FoldingAction<void> {
constructor() {
......@@ -501,8 +493,6 @@ class FoldRecursivelyAction extends FoldingAction<void> {
}
}
@editorAction
// @ts-ignore @editorAction uses the class
class FoldAllAction extends FoldingAction<void> {
constructor() {
......@@ -523,8 +513,6 @@ class FoldAllAction extends FoldingAction<void> {
}
}
@editorAction
// @ts-ignore @editorAction uses the class
class UnfoldAllAction extends FoldingAction<void> {
constructor() {
......@@ -558,6 +546,13 @@ class FoldLevelAction extends FoldingAction<void> {
}
}
registerEditorAction(new UnfoldAction());
registerEditorAction(new UnFoldRecursivelyAction());
registerEditorAction(new FoldAction());
registerEditorAction(new FoldRecursivelyAction());
registerEditorAction(new FoldAllAction());
registerEditorAction(new UnfoldAllAction());
for (let i = 1; i <= 9; i++) {
CommonEditorRegistry.registerEditorAction(
new FoldLevelAction({
......
......@@ -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 { ContextKeyExpr } from 'vs/platform/contextkey/common/contextkey';
import { editorAction, ServicesAccessor, EditorAction, commonEditorContribution, IActionOptions } from 'vs/editor/common/editorCommonExtensions';
import { registerEditorAction, ServicesAccessor, EditorAction, commonEditorContribution, IActionOptions } from 'vs/editor/common/editorCommonExtensions';
import { OnTypeFormattingEditProviderRegistry, DocumentRangeFormattingEditProviderRegistry } from 'vs/editor/common/modes';
import { getOnTypeFormattingEdits, getDocumentFormattingEdits, getDocumentRangeFormattingEdits, NoProviderError } from '../common/format';
import { EditOperationsCommand } from '../common/formatCommand';
......@@ -300,8 +300,6 @@ export abstract class AbstractFormatAction extends EditorAction {
protected abstract _getFormattingEdits(editor: editorCommon.ICommonCodeEditor): TPromise<editorCommon.ISingleEditOperation[]>;
}
@editorAction
export class FormatDocumentAction extends AbstractFormatAction {
constructor() {
......@@ -331,7 +329,6 @@ export class FormatDocumentAction extends AbstractFormatAction {
}
}
@editorAction
export class FormatSelectionAction extends AbstractFormatAction {
constructor() {
......@@ -359,6 +356,9 @@ export class FormatSelectionAction extends AbstractFormatAction {
}
}
registerEditorAction(new FormatDocumentAction());
registerEditorAction(new FormatSelectionAction());
// this is the old format action that does both (format document OR format selection)
// and we keep it here such that existing keybinding configurations etc will still work
CommandsRegistry.registerCommand('editor.action.format', accessor => {
......
......@@ -15,7 +15,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 { editorAction, IActionOptions, ServicesAccessor, EditorAction } from 'vs/editor/common/editorCommonExtensions';
import { registerEditorAction, IActionOptions, ServicesAccessor, EditorAction } from 'vs/editor/common/editorCommonExtensions';
import { Location } from 'vs/editor/common/modes';
import { getDefinitionsAtPosition, getImplementationsAtPosition, getTypeDefinitionsAtPosition } from './goToDeclaration';
import { ReferencesController } from 'vs/editor/contrib/referenceSearch/browser/referencesController';
......@@ -180,7 +180,6 @@ const goToDeclarationKb = platform.isWeb
? KeyMod.CtrlCmd | KeyCode.F12
: KeyCode.F12;
@editorAction
export class GoToDefinitionAction extends DefinitionAction {
public static ID = 'editor.action.goToDeclaration';
......@@ -205,7 +204,6 @@ export class GoToDefinitionAction extends DefinitionAction {
}
}
@editorAction
export class OpenDefinitionToSideAction extends DefinitionAction {
public static ID = 'editor.action.openDeclarationToTheSide';
......@@ -226,7 +224,6 @@ export class OpenDefinitionToSideAction extends DefinitionAction {
}
}
@editorAction
export class PeekDefinitionAction extends DefinitionAction {
constructor() {
super(new DefinitionActionConfig(void 0, true, false), {
......@@ -266,7 +263,6 @@ export class ImplementationAction extends DefinitionAction {
}
}
@editorAction
export class GoToImplementationAction extends ImplementationAction {
public static ID = 'editor.action.goToImplementation';
......@@ -287,7 +283,6 @@ export class GoToImplementationAction extends ImplementationAction {
}
}
@editorAction
export class PeekImplementationAction extends ImplementationAction {
public static ID = 'editor.action.peekImplementation';
......@@ -324,7 +319,6 @@ export class TypeDefinitionAction extends DefinitionAction {
}
}
@editorAction
export class GoToTypeDefintionAction extends TypeDefinitionAction {
public static ID = 'editor.action.goToTypeDefinition';
......@@ -349,7 +343,6 @@ export class GoToTypeDefintionAction extends TypeDefinitionAction {
}
}
@editorAction
export class PeekTypeDefinitionAction extends TypeDefinitionAction {
public static ID = 'editor.action.peekTypeDefinition';
......@@ -370,3 +363,10 @@ export class PeekTypeDefinitionAction extends TypeDefinitionAction {
}
}
registerEditorAction(new GoToDefinitionAction());
registerEditorAction(new OpenDefinitionToSideAction());
registerEditorAction(new PeekDefinitionAction());
registerEditorAction(new GoToImplementationAction());
registerEditorAction(new PeekImplementationAction());
registerEditorAction(new GoToTypeDefintionAction());
registerEditorAction(new PeekTypeDefinitionAction());
......@@ -19,7 +19,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 { editorAction, ServicesAccessor, IActionOptions, EditorAction, EditorCommand, CommonEditorRegistry } from 'vs/editor/common/editorCommonExtensions';
import { registerEditorAction, ServicesAccessor, IActionOptions, EditorAction, EditorCommand, CommonEditorRegistry } from 'vs/editor/common/editorCommonExtensions';
import { ICodeEditor } from 'vs/editor/browser/editorBrowser';
import { editorContribution } from 'vs/editor/browser/editorBrowserExtensions';
import { ZoneWidget } from 'vs/editor/contrib/zoneWidget/browser/zoneWidget';
......@@ -503,8 +503,6 @@ class MarkerController implements editorCommon.IEditorContribution {
}
}
@editorAction
// @ts-ignore @editorAction uses the class
class NextMarkerAction extends MarkerNavigationAction {
constructor() {
super(true, {
......@@ -520,8 +518,6 @@ class NextMarkerAction extends MarkerNavigationAction {
}
}
@editorAction
// @ts-ignore @editorAction uses the class
class PrevMarkerAction extends MarkerNavigationAction {
constructor() {
super(false, {
......@@ -537,6 +533,9 @@ class PrevMarkerAction extends MarkerNavigationAction {
}
}
registerEditorAction(new NextMarkerAction());
registerEditorAction(new PrevMarkerAction());
const CONTEXT_MARKERS_NAVIGATION_VISIBLE = new RawContextKey<boolean>('markersNavigationVisible', false);
const MarkerCommand = EditorCommand.bindToContribution<MarkerController>(MarkerController.get);
......
......@@ -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 { editorAction, ServicesAccessor, EditorAction } from 'vs/editor/common/editorCommonExtensions';
import { registerEditorAction, ServicesAccessor, EditorAction } from 'vs/editor/common/editorCommonExtensions';
import { ICodeEditor, IEditorMouseEvent, MouseTargetType } from 'vs/editor/browser/editorBrowser';
import { editorContribution } from 'vs/editor/browser/editorBrowserExtensions';
import { ModesContentHoverWidget } from './modesContentHover';
......@@ -169,8 +169,6 @@ export class ModesHoverController implements editorCommon.IEditorContribution {
}
}
@editorAction
// @ts-ignore @editorAction uses the class
class ShowHoverAction extends EditorAction {
constructor() {
......@@ -197,6 +195,8 @@ class ShowHoverAction extends EditorAction {
}
}
registerEditorAction(new ShowHoverAction());
// theming
registerThemingParticipant((theme, collector) => {
let editorHoverHighlightColor = theme.getColor(editorHoverHighlight);
......
......@@ -11,7 +11,7 @@ import { Range } from 'vs/editor/common/core/range';
import { Selection } from 'vs/editor/common/core/selection';
import { IEditorContribution, ICommonCodeEditor, IModelDecorationsChangeAccessor } from 'vs/editor/common/editorCommon';
import { EditorContextKeys } from 'vs/editor/common/editorContextKeys';
import { editorAction, ServicesAccessor, EditorAction, commonEditorContribution } from 'vs/editor/common/editorCommonExtensions';
import { registerEditorAction, ServicesAccessor, EditorAction, commonEditorContribution } from 'vs/editor/common/editorCommonExtensions';
import { IInplaceReplaceSupportResult } from 'vs/editor/common/modes';
import { IEditorWorkerService } from 'vs/editor/common/services/editorWorkerService';
import { InPlaceReplaceCommand } from './inPlaceReplaceCommand';
......@@ -138,8 +138,6 @@ class InPlaceReplaceController implements IEditorContribution {
}
}
@editorAction
// @ts-ignore @editorAction uses the class
class InPlaceReplaceUp extends EditorAction {
constructor() {
......@@ -164,8 +162,6 @@ class InPlaceReplaceUp extends EditorAction {
}
}
@editorAction
// @ts-ignore @editorAction uses the class
class InPlaceReplaceDown extends EditorAction {
constructor() {
......@@ -190,9 +186,12 @@ class InPlaceReplaceDown extends EditorAction {
}
}
registerEditorAction(new InPlaceReplaceUp());
registerEditorAction(new InPlaceReplaceDown());
registerThemingParticipant((theme, collector) => {
let border = theme.getColor(editorBracketMatchBorder);
if (border) {
collector.addRule(`.monaco-editor.vs .valueSetReplacement { outline: solid 2px ${border}; }`);
}
});
\ No newline at end of file
});
......@@ -9,7 +9,7 @@ import { TPromise } from 'vs/base/common/winjs.base';
import * as strings from 'vs/base/common/strings';
import { ICommonCodeEditor, IEditorContribution, IIdentifiedSingleEditOperation, ICommand, ICursorStateComputerData, IEditOperationBuilder, ITokenizedModel, EndOfLineSequence } from 'vs/editor/common/editorCommon';
import { EditorContextKeys } from 'vs/editor/common/editorContextKeys';
import { editorAction, ServicesAccessor, IActionOptions, EditorAction, commonEditorContribution } from 'vs/editor/common/editorCommonExtensions';
import { registerEditorAction, ServicesAccessor, IActionOptions, EditorAction, commonEditorContribution } from 'vs/editor/common/editorCommonExtensions';
import { IQuickOpenService } from 'vs/platform/quickOpen/common/quickOpen';
import { IModelService } from 'vs/editor/common/services/modelService';
import { Range } from 'vs/editor/common/core/range';
......@@ -147,7 +147,6 @@ export function getReindentEditOperations(model: ITokenizedModel, startLineNumbe
return indentEdits;
}
@editorAction
export class IndentationToSpacesAction extends EditorAction {
public static ID = 'editor.action.indentationToSpaces';
......@@ -178,7 +177,6 @@ export class IndentationToSpacesAction extends EditorAction {
}
}
@editorAction
export class IndentationToTabsAction extends EditorAction {
public static ID = 'editor.action.indentationToTabs';
......@@ -248,7 +246,6 @@ export class ChangeIndentationSizeAction extends EditorAction {
}
}
@editorAction
export class IndentUsingTabs extends ChangeIndentationSizeAction {
public static ID = 'editor.action.indentUsingTabs';
......@@ -263,7 +260,6 @@ export class IndentUsingTabs extends ChangeIndentationSizeAction {
}
}
@editorAction
export class IndentUsingSpaces extends ChangeIndentationSizeAction {
public static ID = 'editor.action.indentUsingSpaces';
......@@ -278,7 +274,6 @@ export class IndentUsingSpaces extends ChangeIndentationSizeAction {
}
}
@editorAction
export class DetectIndentation extends EditorAction {
public static ID = 'editor.action.detectIndentation';
......@@ -305,7 +300,6 @@ export class DetectIndentation extends EditorAction {
}
}
@editorAction
export class ReindentLinesAction extends EditorAction {
constructor() {
super({
......@@ -333,7 +327,7 @@ export class ReindentLinesAction extends EditorAction {
export class AutoIndentOnPasteCommand implements ICommand {
private _edits: TextEdit[];
// @ts-ignore @editorAction unused property
// @ts-ignore unused property
private _newEol: EndOfLineSequence;
private _initialSelection: Selection;
......@@ -621,3 +615,10 @@ export class IndentationToTabsCommand implements ICommand {
return helper.getTrackedSelection(this.selectionId);
}
}
registerEditorAction(new IndentationToSpacesAction());
registerEditorAction(new IndentationToTabsAction());
registerEditorAction(new IndentUsingTabs());
registerEditorAction(new IndentUsingSpaces());
registerEditorAction(new DetectIndentation());
registerEditorAction(new ReindentLinesAction());
......@@ -15,7 +15,7 @@ import { ReplaceCommand, ReplaceCommandThatPreservesSelection } from 'vs/editor/
import { Range } from 'vs/editor/common/core/range';
import { Selection } from 'vs/editor/common/core/selection';
import { Position } from 'vs/editor/common/core/position';
import { editorAction, ServicesAccessor, IActionOptions, EditorAction } from 'vs/editor/common/editorCommonExtensions';
import { registerEditorAction, ServicesAccessor, IActionOptions, EditorAction } from 'vs/editor/common/editorCommonExtensions';
import { CopyLinesCommand } from './copyLinesCommand';
import { DeleteLinesCommand } from './deleteLinesCommand';
import { MoveLinesCommand } from './moveLinesCommand';
......@@ -48,8 +48,6 @@ abstract class AbstractCopyLinesAction extends EditorAction {
}
}
@editorAction
// @ts-ignore @editorAction uses the class
class CopyLinesUpAction extends AbstractCopyLinesAction {
constructor() {
super(false, {
......@@ -66,8 +64,6 @@ class CopyLinesUpAction extends AbstractCopyLinesAction {
}
}
@editorAction
// @ts-ignore @editorAction uses the class
class CopyLinesDownAction extends AbstractCopyLinesAction {
constructor() {
super(true, {
......@@ -111,8 +107,6 @@ abstract class AbstractMoveLinesAction extends EditorAction {
}
}
@editorAction
// @ts-ignore @editorAction uses the class
class MoveLinesUpAction extends AbstractMoveLinesAction {
constructor() {
super(false, {
......@@ -129,8 +123,6 @@ class MoveLinesUpAction extends AbstractMoveLinesAction {
}
}
@editorAction
// @ts-ignore @editorAction uses the class
class MoveLinesDownAction extends AbstractMoveLinesAction {
constructor() {
super(true, {
......@@ -169,8 +161,6 @@ abstract class AbstractSortLinesAction extends EditorAction {
}
}
@editorAction
// @ts-ignore @editorAction uses the class
class SortLinesAscendingAction extends AbstractSortLinesAction {
constructor() {
super(false, {
......@@ -182,8 +172,6 @@ class SortLinesAscendingAction extends AbstractSortLinesAction {
}
}
@editorAction
// @ts-ignore @editorAction uses the class
class SortLinesDescendingAction extends AbstractSortLinesAction {
constructor() {
super(true, {
......@@ -195,7 +183,6 @@ class SortLinesDescendingAction extends AbstractSortLinesAction {
}
}
@editorAction
export class TrimTrailingWhitespaceAction extends EditorAction {
public static ID = 'editor.action.trimTrailingWhitespace';
......@@ -281,8 +268,6 @@ abstract class AbstractRemoveLinesAction extends EditorAction {
}
}
@editorAction
// @ts-ignore @editorAction uses the class
class DeleteLinesAction extends AbstractRemoveLinesAction {
constructor() {
......@@ -313,7 +298,6 @@ class DeleteLinesAction extends AbstractRemoveLinesAction {
}
}
@editorAction
export class IndentLinesAction extends EditorAction {
constructor() {
super({
......@@ -335,8 +319,6 @@ export class IndentLinesAction extends EditorAction {
}
}
@editorAction
// @ts-ignore @editorAction uses the class
class OutdentLinesAction extends EditorAction {
constructor() {
super({
......@@ -356,7 +338,6 @@ class OutdentLinesAction extends EditorAction {
}
}
@editorAction
export class InsertLineBeforeAction extends EditorAction {
constructor() {
super({
......@@ -377,7 +358,6 @@ export class InsertLineBeforeAction extends EditorAction {
}
}
@editorAction
export class InsertLineAfterAction extends EditorAction {
constructor() {
super({
......@@ -437,7 +417,6 @@ export abstract class AbstractDeleteAllToBoundaryAction extends EditorAction {
protected abstract _getRangesToDelete(editor: ICommonCodeEditor): Range[];
}
@editorAction
export class DeleteAllLeftAction extends AbstractDeleteAllToBoundaryAction {
constructor() {
super({
......@@ -491,7 +470,6 @@ export class DeleteAllLeftAction extends AbstractDeleteAllToBoundaryAction {
}
}
@editorAction
export class DeleteAllRightAction extends AbstractDeleteAllToBoundaryAction {
constructor() {
super({
......@@ -549,7 +527,6 @@ export class DeleteAllRightAction extends AbstractDeleteAllToBoundaryAction {
}
}
@editorAction
export class JoinLinesAction extends EditorAction {
constructor() {
super({
......@@ -698,7 +675,6 @@ export class JoinLinesAction extends EditorAction {
}
}
@editorAction
export class TransposeAction extends EditorAction {
constructor() {
super({
......@@ -784,7 +760,6 @@ export abstract class AbstractCaseAction extends EditorAction {
protected abstract _modifyText(text: string): string;
}
@editorAction
export class UpperCaseAction extends AbstractCaseAction {
constructor() {
super({
......@@ -800,7 +775,6 @@ export class UpperCaseAction extends AbstractCaseAction {
}
}
@editorAction
export class LowerCaseAction extends AbstractCaseAction {
constructor() {
super({
......@@ -815,3 +789,22 @@ export class LowerCaseAction extends AbstractCaseAction {
return text.toLocaleLowerCase();
}
}
registerEditorAction(new CopyLinesUpAction());
registerEditorAction(new CopyLinesDownAction());
registerEditorAction(new MoveLinesUpAction());
registerEditorAction(new MoveLinesDownAction());
registerEditorAction(new SortLinesAscendingAction());
registerEditorAction(new SortLinesDescendingAction());
registerEditorAction(new TrimTrailingWhitespaceAction());
registerEditorAction(new DeleteLinesAction());
registerEditorAction(new IndentLinesAction());
registerEditorAction(new OutdentLinesAction());
registerEditorAction(new InsertLineBeforeAction());
registerEditorAction(new InsertLineAfterAction());
registerEditorAction(new DeleteAllLeftAction());
registerEditorAction(new DeleteAllRightAction());
registerEditorAction(new JoinLinesAction());
registerEditorAction(new TransposeAction());
registerEditorAction(new UpperCaseAction());
registerEditorAction(new LowerCaseAction());
......@@ -14,7 +14,7 @@ import { TPromise } from 'vs/base/common/winjs.base';
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 { editorAction, ServicesAccessor, EditorAction } from 'vs/editor/common/editorCommonExtensions';
import { registerEditorAction, ServicesAccessor, EditorAction } from 'vs/editor/common/editorCommonExtensions';
import { LinkProviderRegistry } from 'vs/editor/common/modes';
import { ICodeEditor, MouseTargetType } from 'vs/editor/browser/editorBrowser';
import { getLinks, Link } from 'vs/editor/contrib/links/common/links';
......@@ -384,8 +384,6 @@ class LinkDetector implements editorCommon.IEditorContribution {
}
}
@editorAction
// @ts-ignore @editorAction uses the class
class OpenLinkAction extends EditorAction {
constructor() {
......@@ -410,6 +408,8 @@ class OpenLinkAction extends EditorAction {
}
}
registerEditorAction(new OpenLinkAction());
registerThemingParticipant((theme, collector) => {
let activeLinkForeground = theme.getColor(editorActiveLinkForeground);
if (activeLinkForeground) {
......
......@@ -10,7 +10,7 @@ import { KeyCode, KeyMod, KeyChord } from 'vs/base/common/keyCodes';
import { RunOnceScheduler } from 'vs/base/common/async';
import { ICommonCodeEditor, ScrollType, IEditorContribution, FindMatch, TrackedRangeStickiness, OverviewRulerLane, IModel } from 'vs/editor/common/editorCommon';
import { EditorContextKeys } from 'vs/editor/common/editorContextKeys';
import { editorAction, commonEditorContribution, ServicesAccessor, EditorAction } from 'vs/editor/common/editorCommonExtensions';
import { registerEditorAction, commonEditorContribution, ServicesAccessor, EditorAction } from 'vs/editor/common/editorCommonExtensions';
import { Range } from 'vs/editor/common/core/range';
import { Selection } from 'vs/editor/common/core/selection';
import { CursorChangeReason, ICursorSelectionChangedEvent } from 'vs/editor/common/controller/cursorEvents';
......@@ -24,7 +24,6 @@ import { overviewRulerSelectionHighlightForeground } from 'vs/platform/theme/com
import { themeColorFromId } from 'vs/platform/theme/common/themeService';
import { INewFindReplaceState, FindOptionOverride } from 'vs/editor/contrib/find/common/findState';
@editorAction
export class InsertCursorAbove extends EditorAction {
constructor() {
super({
......@@ -64,7 +63,6 @@ export class InsertCursorAbove extends EditorAction {
}
}
@editorAction
export class InsertCursorBelow extends EditorAction {
constructor() {
super({
......@@ -104,8 +102,6 @@ export class InsertCursorBelow extends EditorAction {
}
}
@editorAction
// @ts-ignore @editorAction uses the class
class InsertCursorAtEndOfEachLineSelected extends EditorAction {
constructor() {
......@@ -522,7 +518,6 @@ export abstract class MultiCursorSelectionControllerAction extends EditorAction
protected abstract _run(multiCursorController: MultiCursorSelectionController, findController: CommonFindController): void;
}
@editorAction
export class AddSelectionToNextFindMatchAction extends MultiCursorSelectionControllerAction {
constructor() {
super({
......@@ -541,7 +536,6 @@ export class AddSelectionToNextFindMatchAction extends MultiCursorSelectionContr
}
}
@editorAction
export class AddSelectionToPreviousFindMatchAction extends MultiCursorSelectionControllerAction {
constructor() {
super({
......@@ -556,7 +550,6 @@ export class AddSelectionToPreviousFindMatchAction extends MultiCursorSelectionC
}
}
@editorAction
export class MoveSelectionToNextFindMatchAction extends MultiCursorSelectionControllerAction {
constructor() {
super({
......@@ -575,7 +568,6 @@ export class MoveSelectionToNextFindMatchAction extends MultiCursorSelectionCont
}
}
@editorAction
export class MoveSelectionToPreviousFindMatchAction extends MultiCursorSelectionControllerAction {
constructor() {
super({
......@@ -590,7 +582,6 @@ export class MoveSelectionToPreviousFindMatchAction extends MultiCursorSelection
}
}
@editorAction
export class SelectHighlightsAction extends MultiCursorSelectionControllerAction {
constructor() {
super({
......@@ -609,7 +600,6 @@ export class SelectHighlightsAction extends MultiCursorSelectionControllerAction
}
}
@editorAction
export class CompatChangeAll extends MultiCursorSelectionControllerAction {
constructor() {
super({
......@@ -911,3 +901,13 @@ function getValueInRange(model: IModel, range: Range, toLowerCase: boolean): str
const text = model.getValueInRange(range);
return (toLowerCase ? text.toLowerCase() : text);
}
registerEditorAction(new InsertCursorAbove());
registerEditorAction(new InsertCursorBelow());
registerEditorAction(new InsertCursorAtEndOfEachLineSelected());
registerEditorAction(new AddSelectionToNextFindMatchAction());
registerEditorAction(new AddSelectionToPreviousFindMatchAction());
registerEditorAction(new MoveSelectionToNextFindMatchAction());
registerEditorAction(new MoveSelectionToPreviousFindMatchAction());
registerEditorAction(new SelectHighlightsAction());
registerEditorAction(new CompatChangeAll());
......@@ -11,7 +11,7 @@ import { IInstantiationService } from 'vs/platform/instantiation/common/instanti
import { ICommonCodeEditor, IEditorContribution } from 'vs/editor/common/editorCommon';
import { EditorContextKeys } from 'vs/editor/common/editorContextKeys';
import { ContextKeyExpr } from 'vs/platform/contextkey/common/contextkey';
import { editorAction, ServicesAccessor, EditorAction, EditorCommand, CommonEditorRegistry } from 'vs/editor/common/editorCommonExtensions';
import { registerEditorAction, ServicesAccessor, EditorAction, EditorCommand, CommonEditorRegistry } from 'vs/editor/common/editorCommonExtensions';
import { ICodeEditor } from 'vs/editor/browser/editorBrowser';
import { editorContribution } from 'vs/editor/browser/editorBrowserExtensions';
import { ParameterHintsWidget } from './parameterHintsWidget';
......@@ -59,7 +59,6 @@ class ParameterHintsController implements IEditorContribution {
}
}
@editorAction
export class TriggerParameterHintsAction extends EditorAction {
constructor() {
......@@ -83,6 +82,8 @@ export class TriggerParameterHintsAction extends EditorAction {
}
}
registerEditorAction(new TriggerParameterHintsAction());
const weight = CommonEditorRegistry.commandWeight(75);
const ParameterHintsCommand = EditorCommand.bindToContribution<ParameterHintsController>(ParameterHintsController.get);
......
......@@ -14,7 +14,7 @@ import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding';
import { IMarkerService } from 'vs/platform/markers/common/markers';
import { ICommonCodeEditor, IEditorContribution } from 'vs/editor/common/editorCommon';
import { EditorContextKeys } from 'vs/editor/common/editorContextKeys';
import { editorAction, ServicesAccessor, EditorAction } from 'vs/editor/common/editorCommonExtensions';
import { registerEditorAction, ServicesAccessor, EditorAction } from 'vs/editor/common/editorCommonExtensions';
import { ICodeEditor } from 'vs/editor/browser/editorBrowser';
import { editorContribution } from 'vs/editor/browser/editorBrowserExtensions';
import { QuickFixContextMenu } from './quickFixWidget';
......@@ -105,7 +105,6 @@ export class QuickFixController implements IEditorContribution {
}
}
@editorAction
export class QuickFixAction extends EditorAction {
static Id = 'editor.action.quickFix';
......@@ -130,3 +129,5 @@ export class QuickFixAction extends EditorAction {
}
}
}
registerEditorAction(new QuickFixAction());
......@@ -15,7 +15,7 @@ import { KeybindingsRegistry } from 'vs/platform/keybinding/common/keybindingsRe
import { Position, IPosition } from 'vs/editor/common/core/position';
import { Range } from 'vs/editor/common/core/range';
import * as editorCommon from 'vs/editor/common/editorCommon';
import { editorAction, ServicesAccessor, EditorAction, CommonEditorRegistry, commonEditorContribution } from 'vs/editor/common/editorCommonExtensions';
import { registerEditorAction, ServicesAccessor, EditorAction, CommonEditorRegistry, commonEditorContribution } from 'vs/editor/common/editorCommonExtensions';
import { Location, ReferenceProviderRegistry } from 'vs/editor/common/modes';
import { PeekContext, getOuterEditor } from './peekViewWidget';
import { ReferencesController, RequestOptions, ctxReferenceSearchVisible } from './referencesController';
......@@ -53,7 +53,6 @@ export class ReferenceController implements editorCommon.IEditorContribution {
}
}
@editorAction
export class ReferenceAction extends EditorAction {
constructor() {
......@@ -88,6 +87,8 @@ export class ReferenceAction extends EditorAction {
}
}
registerEditorAction(new ReferenceAction());
let findReferencesCommand: ICommandHandler = (accessor: ServicesAccessor, resource: URI, position: IPosition) => {
if (!(resource instanceof URI)) {
......
......@@ -14,7 +14,7 @@ import { IFileService } from 'vs/platform/files/common/files';
import { RawContextKey, IContextKey, IContextKeyService, ContextKeyExpr } from 'vs/platform/contextkey/common/contextkey';
import { IMessageService } from 'vs/platform/message/common/message';
import { IProgressService } from 'vs/platform/progress/common/progress';
import { editorAction, ServicesAccessor, EditorAction, EditorCommand, CommonEditorRegistry } from 'vs/editor/common/editorCommonExtensions';
import { registerEditorAction, ServicesAccessor, EditorAction, EditorCommand, CommonEditorRegistry } from 'vs/editor/common/editorCommonExtensions';
import { editorContribution } from 'vs/editor/browser/editorBrowserExtensions';
import { ICommonCodeEditor, IEditorContribution, IReadOnlyModel } from 'vs/editor/common/editorCommon';
import { EditorContextKeys } from 'vs/editor/common/editorContextKeys';
......@@ -201,7 +201,6 @@ class RenameController implements IEditorContribution {
// ---- action implementation
@editorAction
export class RenameAction extends EditorAction {
constructor() {
......@@ -230,6 +229,8 @@ export class RenameAction extends EditorAction {
}
}
registerEditorAction(new RenameAction());
const RenameCommand = EditorCommand.bindToContribution<RenameController>(RenameController.get);
CommonEditorRegistry.registerEditorCommand(new RenameCommand({
......
......@@ -12,7 +12,7 @@ import { IInstantiationService } from 'vs/platform/instantiation/common/instanti
import { Range } from 'vs/editor/common/core/range';
import { ICommonCodeEditor, IEditorContribution } from 'vs/editor/common/editorCommon';
import { EditorContextKeys } from 'vs/editor/common/editorContextKeys';
import { editorAction, ServicesAccessor, IActionOptions, EditorAction, commonEditorContribution } from 'vs/editor/common/editorCommonExtensions';
import { registerEditorAction, ServicesAccessor, IActionOptions, EditorAction, commonEditorContribution } from 'vs/editor/common/editorCommonExtensions';
import { TokenSelectionSupport, ILogicalSelectionEntry } from './tokenSelectionSupport';
import { ICursorPositionChangedEvent } from 'vs/editor/common/controller/cursorEvents';
......@@ -163,8 +163,6 @@ abstract class AbstractSmartSelect extends EditorAction {
}
}
@editorAction
// @ts-ignore @editorAction uses the class
class GrowSelectionAction extends AbstractSmartSelect {
constructor() {
super(true, {
......@@ -181,8 +179,6 @@ class GrowSelectionAction extends AbstractSmartSelect {
}
}
@editorAction
// @ts-ignore @editorAction uses the class
class ShrinkSelectionAction extends AbstractSmartSelect {
constructor() {
super(false, {
......@@ -198,3 +194,6 @@ class ShrinkSelectionAction extends AbstractSmartSelect {
});
}
}
registerEditorAction(new GrowSelectionAction());
registerEditorAction(new ShrinkSelectionAction());
......@@ -15,7 +15,7 @@ import { ContextKeyExpr, IContextKeyService } from 'vs/platform/contextkey/commo
import { ICommandService } from 'vs/platform/commands/common/commands';
import { ICommonCodeEditor, IEditorContribution, ScrollType } from 'vs/editor/common/editorCommon';
import { EditorContextKeys } from 'vs/editor/common/editorContextKeys';
import { editorAction, ServicesAccessor, EditorAction, EditorCommand, CommonEditorRegistry } from 'vs/editor/common/editorCommonExtensions';
import { registerEditorAction, ServicesAccessor, EditorAction, EditorCommand, CommonEditorRegistry } from 'vs/editor/common/editorCommonExtensions';
import { ICodeEditor } from 'vs/editor/browser/editorBrowser';
import { alert } from 'vs/base/browser/ui/aria/aria';
import { editorContribution } from 'vs/editor/browser/editorBrowserExtensions';
......@@ -295,7 +295,6 @@ export class SuggestController implements IEditorContribution {
}
}
@editorAction
export class TriggerSuggestAction extends EditorAction {
static readonly id = 'editor.action.triggerSuggest';
......@@ -325,6 +324,8 @@ export class TriggerSuggestAction extends EditorAction {
}
}
registerEditorAction(new TriggerSuggestAction());
const weight = CommonEditorRegistry.commandWeight(90);
const SuggestCommand = EditorCommand.bindToContribution<SuggestController>(SuggestController.get);
......
......@@ -7,10 +7,9 @@
import * as nls from 'vs/nls';
import { KeyCode, KeyMod } from 'vs/base/common/keyCodes';
import { ICommonCodeEditor } from 'vs/editor/common/editorCommon';
import { editorAction, ServicesAccessor, EditorAction } from 'vs/editor/common/editorCommonExtensions';
import { registerEditorAction, ServicesAccessor, EditorAction } from 'vs/editor/common/editorCommonExtensions';
import { TabFocus } from 'vs/editor/common/config/commonEditorConfig';
@editorAction
export class ToggleTabFocusModeAction extends EditorAction {
public static ID = 'editor.action.toggleTabFocusMode';
......@@ -34,3 +33,5 @@ export class ToggleTabFocusModeAction extends EditorAction {
TabFocus.setTabFocusMode(!oldValue);
}
}
registerEditorAction(new ToggleTabFocusModeAction());
......@@ -11,7 +11,7 @@ import { onUnexpectedExternalError } from 'vs/base/common/errors';
import { TPromise } from 'vs/base/common/winjs.base';
import { Range } from 'vs/editor/common/core/range';
import * as editorCommon from 'vs/editor/common/editorCommon';
import { CommonEditorRegistry, commonEditorContribution, EditorAction, IActionOptions, editorAction } from 'vs/editor/common/editorCommonExtensions';
import { CommonEditorRegistry, commonEditorContribution, EditorAction, IActionOptions, registerEditorAction } from 'vs/editor/common/editorCommonExtensions';
import { DocumentHighlight, DocumentHighlightKind, DocumentHighlightProviderRegistry } from 'vs/editor/common/modes';
import { IDisposable, dispose } from 'vs/base/common/lifecycle';
import { Position } from 'vs/editor/common/core/position';
......@@ -490,8 +490,6 @@ class WordHighlightNavigationAction extends EditorAction {
}
}
@editorAction
// @ts-ignore @editorAction uses the class
class NextWordHighlightAction extends WordHighlightNavigationAction {
constructor() {
super(true, {
......@@ -507,8 +505,6 @@ class NextWordHighlightAction extends WordHighlightNavigationAction {
}
}
@editorAction
// @ts-ignore @editorAction uses the class
class PrevWordHighlightAction extends WordHighlightNavigationAction {
constructor() {
super(false, {
......@@ -522,4 +518,7 @@ class PrevWordHighlightAction extends WordHighlightNavigationAction {
}
});
}
}
\ No newline at end of file
}
registerEditorAction(new NextWordHighlightAction());
registerEditorAction(new PrevWordHighlightAction());
......@@ -18,7 +18,7 @@ import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding';
import { RawContextKey, IContextKey, IContextKeyService } from 'vs/platform/contextkey/common/contextkey';
import { ICommonCodeEditor, IEditorContribution } from 'vs/editor/common/editorCommon';
import { EditorContextKeys } from 'vs/editor/common/editorContextKeys';
import { editorAction, CommonEditorRegistry, EditorAction, EditorCommand } from 'vs/editor/common/editorCommonExtensions';
import { registerEditorAction, CommonEditorRegistry, EditorAction, EditorCommand } from 'vs/editor/common/editorCommonExtensions';
import { ICodeEditor, IOverlayWidget, IOverlayWidgetPosition } from 'vs/editor/browser/editorBrowser';
import { editorContribution } from 'vs/editor/browser/editorBrowserExtensions';
import { ToggleTabFocusModeAction } from 'vs/editor/contrib/toggleTabFocusMode/common/toggleTabFocusMode';
......@@ -334,8 +334,6 @@ class AccessibilityHelpWidget extends Widget implements IOverlayWidget {
}
}
@editorAction
// @ts-ignore @editorAction uses the class
class ShowAccessibilityHelpAction extends EditorAction {
constructor() {
super({
......@@ -358,6 +356,8 @@ class ShowAccessibilityHelpAction extends EditorAction {
}
}
registerEditorAction(new ShowAccessibilityHelpAction());
const AccessibilityHelpCommand = EditorCommand.bindToContribution<AccessibilityHelpController>(AccessibilityHelpController.get);
CommonEditorRegistry.registerEditorCommand(
......
......@@ -10,7 +10,7 @@ import { Disposable } from 'vs/base/common/lifecycle';
import { escape } from 'vs/base/common/strings';
import { Position } from 'vs/editor/common/core/position';
import { ICommonCodeEditor, IEditorContribution, IModel } from 'vs/editor/common/editorCommon';
import { editorAction, EditorAction, ServicesAccessor } from 'vs/editor/common/editorCommonExtensions';
import { registerEditorAction, EditorAction, ServicesAccessor } from 'vs/editor/common/editorCommonExtensions';
import { ICodeEditor, ContentWidgetPositionPreference, IContentWidget, IContentWidgetPosition } from 'vs/editor/browser/editorBrowser';
import { editorContribution } from 'vs/editor/browser/editorBrowserExtensions';
import { IModeService } from 'vs/editor/common/services/modeService';
......@@ -82,8 +82,6 @@ class InspectTokensController extends Disposable implements IEditorContribution
}
}
@editorAction
// @ts-ignore @editorAction uses the class
class InspectTokens extends EditorAction {
constructor() {
......@@ -333,6 +331,8 @@ class InspectTokensWidget extends Disposable implements IContentWidget {
}
}
registerEditorAction(new InspectTokens());
registerThemingParticipant((theme, collector) => {
let border = theme.getColor(editorHoverBorder);
if (border) {
......@@ -344,4 +344,4 @@ registerThemingParticipant((theme, collector) => {
if (background) {
collector.addRule(`.monaco-editor .tokens-inspect-widget { background-color: ${background}; }`);
}
});
\ No newline at end of file
});
......@@ -13,7 +13,7 @@ import * as editorCommon from 'vs/editor/common/editorCommon';
import { EditorContextKeys } from 'vs/editor/common/editorContextKeys';
import { ICodeEditor, IDiffEditor } from 'vs/editor/browser/editorBrowser';
import { BaseEditorQuickOpenAction, IDecorator } from './editorQuickOpen';
import { editorAction, ServicesAccessor } from 'vs/editor/common/editorCommonExtensions';
import { registerEditorAction, ServicesAccessor } from 'vs/editor/common/editorCommonExtensions';
import { KeyCode, KeyMod } from 'vs/base/common/keyCodes';
import { Position } from 'vs/editor/common/core/position';
import { Range } from 'vs/editor/common/core/range';
......@@ -141,7 +141,6 @@ export class GotoLineEntry extends QuickOpenEntry {
}
}
@editorAction
export class GotoLineAction extends BaseEditorQuickOpenAction {
constructor() {
......@@ -172,3 +171,5 @@ export class GotoLineAction extends BaseEditorQuickOpenAction {
});
}
}
registerEditorAction(new GotoLineAction());
......@@ -14,7 +14,7 @@ import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding';
import { IEditorAction, ICommonCodeEditor, IEditor } from 'vs/editor/common/editorCommon';
import { EditorContextKeys } from 'vs/editor/common/editorContextKeys';
import { BaseEditorQuickOpenAction } from './editorQuickOpen';
import { editorAction, ServicesAccessor } from 'vs/editor/common/editorCommonExtensions';
import { registerEditorAction, ServicesAccessor } from 'vs/editor/common/editorCommonExtensions';
import { KeyCode, KeyMod } from 'vs/base/common/keyCodes';
import * as browser from 'vs/base/browser/browser';
......@@ -68,7 +68,6 @@ export class EditorActionCommandEntry extends QuickOpenEntryGroup {
}
}
@editorAction
export class QuickCommandAction extends BaseEditorQuickOpenAction {
constructor() {
......@@ -132,4 +131,6 @@ export class QuickCommandAction extends BaseEditorQuickOpenAction {
return entries;
}
}
\ No newline at end of file
}
registerEditorAction(new QuickCommandAction());
......@@ -18,7 +18,7 @@ import { EditorContextKeys } from 'vs/editor/common/editorContextKeys';
import { SymbolInformation, DocumentSymbolProviderRegistry, symbolKindToCssClass, IOutline } from 'vs/editor/common/modes';
import { BaseEditorQuickOpenAction, IDecorator } from './editorQuickOpen';
import { getDocumentSymbols } from 'vs/editor/contrib/quickOpen/common/quickOpen';
import { editorAction, ServicesAccessor } from 'vs/editor/common/editorCommonExtensions';
import { registerEditorAction, ServicesAccessor } from 'vs/editor/common/editorCommonExtensions';
import { KeyCode, KeyMod } from 'vs/base/common/keyCodes';
import { Range } from 'vs/editor/common/core/range';
......@@ -109,7 +109,6 @@ class SymbolEntry extends QuickOpenEntryGroup {
}
}
@editorAction
export class QuickOutlineAction extends BaseEditorQuickOpenAction {
constructor() {
......@@ -314,3 +313,5 @@ export class QuickOutlineAction extends BaseEditorQuickOpenAction {
return elementARange.startLineNumber - elementBRange.startLineNumber;
}
}
registerEditorAction(new QuickOutlineAction());
......@@ -6,11 +6,9 @@
import * as nls from 'vs/nls';
import { ICommonCodeEditor } from 'vs/editor/common/editorCommon';
import { editorAction, EditorAction, ServicesAccessor } from 'vs/editor/common/editorCommonExtensions';
import { registerEditorAction, EditorAction, ServicesAccessor } from 'vs/editor/common/editorCommonExtensions';
import { IStandaloneThemeService } from 'vs/editor/standalone/common/standaloneThemeService';
@editorAction
// @ts-ignore @editorAction uses the class
class ToggleHighContrast extends EditorAction {
private _originalThemeName: string;
......@@ -37,3 +35,5 @@ class ToggleHighContrast extends EditorAction {
}
}
}
registerEditorAction(new ToggleHighContrast());
......@@ -19,7 +19,7 @@ import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding';
import { RawContextKey, IContextKey, IContextKeyService } from 'vs/platform/contextkey/common/contextkey';
import { ICommonCodeEditor, IEditorContribution } from 'vs/editor/common/editorCommon';
import { EditorContextKeys } from 'vs/editor/common/editorContextKeys';
import { editorAction, CommonEditorRegistry, EditorAction, EditorCommand } from 'vs/editor/common/editorCommonExtensions';
import { registerEditorAction, CommonEditorRegistry, EditorAction, EditorCommand } from 'vs/editor/common/editorCommonExtensions';
import { ICodeEditor, IOverlayWidget, IOverlayWidgetPosition } from 'vs/editor/browser/editorBrowser';
import { editorContribution } from 'vs/editor/browser/editorBrowserExtensions';
import { ToggleTabFocusModeAction } from 'vs/editor/contrib/toggleTabFocusMode/common/toggleTabFocusMode';
......@@ -277,8 +277,6 @@ class AccessibilityHelpWidget extends Widget implements IOverlayWidget {
}
}
@editorAction
// @ts-ignore @editorAction uses the class
class ShowAccessibilityHelpAction extends EditorAction {
constructor() {
......@@ -302,6 +300,8 @@ class ShowAccessibilityHelpAction extends EditorAction {
}
}
registerEditorAction(new ShowAccessibilityHelpAction());
const AccessibilityHelpCommand = EditorCommand.bindToContribution<AccessibilityHelpController>(AccessibilityHelpController.get);
CommonEditorRegistry.registerEditorCommand(new AccessibilityHelpCommand({
......
......@@ -6,14 +6,12 @@
import * as nls from 'vs/nls';
import { ICommonCodeEditor } from 'vs/editor/common/editorCommon';
import { editorAction, ServicesAccessor, EditorAction } from 'vs/editor/common/editorCommonExtensions';
import { registerEditorAction, ServicesAccessor, EditorAction } from 'vs/editor/common/editorCommonExtensions';
import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding';
import { WorkbenchKeybindingService } from 'vs/workbench/services/keybinding/electron-browser/keybindingService';
import { IWorkbenchEditorService } from 'vs/workbench/services/editor/common/editorService';
import { IUntitledResourceInput } from 'vs/platform/editor/common/editor';
@editorAction
// @ts-ignore @editorAction uses the class
class InspectKeyMap extends EditorAction {
constructor() {
......@@ -34,3 +32,5 @@ class InspectKeyMap extends EditorAction {
}
}
}
registerEditorAction(new InspectKeyMap());
......@@ -12,7 +12,7 @@ import { escape } from 'vs/base/common/strings';
import { KeyCode } from 'vs/base/common/keyCodes';
import { Position } from 'vs/editor/common/core/position';
import { ICommonCodeEditor, IEditorContribution, IModel } from 'vs/editor/common/editorCommon';
import { editorAction, EditorAction, ServicesAccessor } from 'vs/editor/common/editorCommonExtensions';
import { registerEditorAction, EditorAction, ServicesAccessor } from 'vs/editor/common/editorCommonExtensions';
import { ICodeEditor, ContentWidgetPositionPreference, IContentWidget, IContentWidgetPosition } from 'vs/editor/browser/editorBrowser';
import { editorContribution } from 'vs/editor/browser/editorBrowserExtensions';
import { TPromise } from 'vs/base/common/winjs.base';
......@@ -101,8 +101,6 @@ class InspectTMScopesController extends Disposable implements IEditorContributio
}
}
@editorAction
// @ts-ignore @editorAction uses the class
class InspectTMScopes extends EditorAction {
constructor() {
......@@ -377,6 +375,8 @@ class InspectTMScopesWidget extends Disposable implements IContentWidget {
}
}
registerEditorAction(new InspectTMScopes());
registerThemingParticipant((theme, collector) => {
let border = theme.getColor(editorHoverBorder);
if (border) {
......@@ -388,4 +388,4 @@ registerThemingParticipant((theme, collector) => {
if (background) {
collector.addRule(`.monaco-editor .tm-inspect-widget { background-color: ${background}; }`);
}
});
\ No newline at end of file
});
......@@ -6,10 +6,9 @@
import * as nls from 'vs/nls';
import { ICommonCodeEditor } from 'vs/editor/common/editorCommon';
import { editorAction, ServicesAccessor, EditorAction } from 'vs/editor/common/editorCommonExtensions';
import { registerEditorAction, ServicesAccessor, EditorAction } from 'vs/editor/common/editorCommonExtensions';
import { IConfigurationService, ConfigurationTarget } from 'vs/platform/configuration/common/configuration';
@editorAction
export class ToggleMinimapAction extends EditorAction {
constructor() {
......@@ -29,3 +28,5 @@ export class ToggleMinimapAction extends EditorAction {
configurationService.updateValue('editor.minimap.enabled', newValue, ConfigurationTarget.USER);
}
}
registerEditorAction(new ToggleMinimapAction());
......@@ -6,10 +6,9 @@
import * as nls from 'vs/nls';
import { ICommonCodeEditor } from 'vs/editor/common/editorCommon';
import { editorAction, ServicesAccessor, EditorAction } from 'vs/editor/common/editorCommonExtensions';
import { registerEditorAction, ServicesAccessor, EditorAction } from 'vs/editor/common/editorCommonExtensions';
import { IConfigurationService, ConfigurationTarget } from 'vs/platform/configuration/common/configuration';
@editorAction
export class ToggleRenderControlCharacterAction extends EditorAction {
constructor() {
......@@ -29,3 +28,5 @@ export class ToggleRenderControlCharacterAction extends EditorAction {
configurationService.updateValue('editor.renderControlCharacters', newRenderControlCharacters, ConfigurationTarget.USER);
}
}
registerEditorAction(new ToggleRenderControlCharacterAction());
......@@ -6,10 +6,9 @@
import * as nls from 'vs/nls';
import { ICommonCodeEditor } from 'vs/editor/common/editorCommon';
import { editorAction, ServicesAccessor, EditorAction } from 'vs/editor/common/editorCommonExtensions';
import { registerEditorAction, ServicesAccessor, EditorAction } from 'vs/editor/common/editorCommonExtensions';
import { IConfigurationService, ConfigurationTarget } from 'vs/platform/configuration/common/configuration';
@editorAction
export class ToggleRenderWhitespaceAction extends EditorAction {
constructor() {
......@@ -35,3 +34,5 @@ export class ToggleRenderWhitespaceAction extends EditorAction {
configurationService.updateValue('editor.renderWhitespace', newRenderWhitespace, ConfigurationTarget.USER);
}
}
registerEditorAction(new ToggleRenderWhitespaceAction());
......@@ -8,7 +8,7 @@ import 'vs/css!./media/codeEditor';
import * as nls from 'vs/nls';
import { KeyCode, KeyMod } from 'vs/base/common/keyCodes';
import { ICommonCodeEditor, IEditorContribution, IModel } from 'vs/editor/common/editorCommon';
import { editorAction, ServicesAccessor, EditorAction, commonEditorContribution } from 'vs/editor/common/editorCommonExtensions';
import { registerEditorAction, ServicesAccessor, EditorAction, commonEditorContribution } from 'vs/editor/common/editorCommonExtensions';
import { ICodeEditorService } from 'vs/editor/common/services/codeEditorService';
import { MenuRegistry, MenuId } from 'vs/platform/actions/common/actions';
import { ContextKeyExpr, IContextKeyService } from 'vs/platform/contextkey/common/contextkey';
......@@ -130,8 +130,6 @@ function applyWordWrapState(editor: ICommonCodeEditor, state: IWordWrapState): v
});
}
@editorAction
// @ts-ignore @editorAction uses the class
class ToggleWordWrapAction extends EditorAction {
constructor() {
......@@ -252,6 +250,8 @@ function canToggleWordWrap(uri: URI): boolean {
return (uri.scheme !== 'output' && uri.scheme !== 'vscode');
}
registerEditorAction(new ToggleWordWrapAction());
MenuRegistry.appendMenuItem(MenuId.EditorTitle, {
command: {
id: 'editor.action.toggleWordWrap',
......
......@@ -9,14 +9,12 @@ import { KeyMod, KeyChord, KeyCode } from 'vs/base/common/keyCodes';
import { Range } from 'vs/editor/common/core/range';
import { ICommonCodeEditor } from 'vs/editor/common/editorCommon';
import { EditorContextKeys } from 'vs/editor/common/editorContextKeys';
import { ServicesAccessor, editorAction, EditorAction, CommonEditorRegistry, EditorCommand } from 'vs/editor/common/editorCommonExtensions';
import { ServicesAccessor, registerEditorAction, EditorAction, CommonEditorRegistry, EditorCommand } from 'vs/editor/common/editorCommonExtensions';
import { ContextKeyExpr } from 'vs/platform/contextkey/common/contextkey';
import { IDebugService, CONTEXT_IN_DEBUG_MODE, CONTEXT_NOT_IN_DEBUG_REPL, CONTEXT_DEBUG_STATE, State, REPL_ID, VIEWLET_ID, IDebugEditorContribution, EDITOR_CONTRIBUTION_ID, CONTEXT_BREAKPOINT_WIDGET_VISIBLE } from 'vs/workbench/parts/debug/common/debug';
import { IPanelService } from 'vs/workbench/services/panel/common/panelService';
import { IViewletService } from 'vs/workbench/services/viewlet/browser/viewlet';
@editorAction
// @ts-ignore @editorAction uses the class
class ToggleBreakpointAction extends EditorAction {
constructor() {
super({
......@@ -68,8 +66,6 @@ function addColumnBreakpoint(accessor: ServicesAccessor, editor: ICommonCodeEdit
return TPromise.as(null);
}
@editorAction
// @ts-ignore @editorAction uses the class
class ToggleColumnBreakpointAction extends EditorAction {
constructor() {
super({
......@@ -90,8 +86,6 @@ class ToggleColumnBreakpointAction extends EditorAction {
}
// TODO@Isidor merge two column breakpoints actions together
@editorAction
// @ts-ignore @editorAction uses the class
class ToggleColumnBreakpointContextMenuAction extends EditorAction {
constructor() {
super({
......@@ -111,8 +105,6 @@ class ToggleColumnBreakpointContextMenuAction extends EditorAction {
}
}
@editorAction
// @ts-ignore @editorAction uses the class
class ConditionalBreakpointAction extends EditorAction {
constructor() {
......@@ -135,8 +127,6 @@ class ConditionalBreakpointAction extends EditorAction {
}
@editorAction
// @ts-ignore @editorAction uses the class
class RunToCursorAction extends EditorAction {
constructor() {
......@@ -179,8 +169,6 @@ class RunToCursorAction extends EditorAction {
}
}
@editorAction
// @ts-ignore @editorAction uses the class
class SelectionToReplAction extends EditorAction {
constructor() {
......@@ -207,8 +195,6 @@ class SelectionToReplAction extends EditorAction {
}
}
@editorAction
// @ts-ignore @editorAction uses the class
class SelectionToWatchExpressionsAction extends EditorAction {
constructor() {
......@@ -233,8 +219,6 @@ class SelectionToWatchExpressionsAction extends EditorAction {
}
}
@editorAction
// @ts-ignore @editorAction uses the class
class ShowDebugHoverAction extends EditorAction {
constructor() {
......@@ -282,4 +266,13 @@ class CloseBreakpointWidgetCommand extends EditorCommand {
}
}
registerEditorAction(new ToggleBreakpointAction());
registerEditorAction(new ToggleColumnBreakpointAction());
registerEditorAction(new ToggleColumnBreakpointContextMenuAction());
registerEditorAction(new ConditionalBreakpointAction());
registerEditorAction(new RunToCursorAction());
registerEditorAction(new SelectionToReplAction());
registerEditorAction(new SelectionToWatchExpressionsAction());
registerEditorAction(new ShowDebugHoverAction());
CommonEditorRegistry.registerEditorCommand(new CloseBreakpointWidgetCommand());
......@@ -23,7 +23,7 @@ import { IReadOnlyModel, ICommonCodeEditor } from 'vs/editor/common/editorCommon
import { EditorContextKeys } from 'vs/editor/common/editorContextKeys';
import { Position } from 'vs/editor/common/core/position';
import * as modes from 'vs/editor/common/modes';
import { editorAction, ServicesAccessor, EditorAction, EditorCommand, CommonEditorRegistry } from 'vs/editor/common/editorCommonExtensions';
import { registerEditorAction, ServicesAccessor, EditorAction, EditorCommand, CommonEditorRegistry } from 'vs/editor/common/editorCommonExtensions';
import { IModelService } from 'vs/editor/common/services/modelService';
import { MenuId } from 'vs/platform/actions/common/actions';
import { ServiceCollection } from 'vs/platform/instantiation/common/serviceCollection';
......@@ -312,8 +312,6 @@ export class Repl extends Panel implements IPrivateReplService {
}
}
@editorAction
// @ts-ignore @editorAction uses the class
class ReplHistoryPreviousAction extends EditorAction {
constructor() {
......@@ -338,8 +336,6 @@ class ReplHistoryPreviousAction extends EditorAction {
}
}
@editorAction
// @ts-ignore @editorAction uses the class
class ReplHistoryNextAction extends EditorAction {
constructor() {
......@@ -364,8 +360,6 @@ class ReplHistoryNextAction extends EditorAction {
}
}
@editorAction
// @ts-ignore @editorAction uses the class
class AcceptReplInputAction extends EditorAction {
constructor() {
......@@ -387,19 +381,6 @@ class AcceptReplInputAction extends EditorAction {
}
}
const SuggestCommand = EditorCommand.bindToContribution<SuggestController>(SuggestController.get);
CommonEditorRegistry.registerEditorCommand(new SuggestCommand({
id: 'repl.action.acceptSuggestion',
precondition: ContextKeyExpr.and(debug.CONTEXT_IN_DEBUG_REPL, SuggestContext.Visible),
handler: x => x.acceptSelectedSuggestion(),
kbOpts: {
weight: 50,
kbExpr: EditorContextKeys.textFocus,
primary: KeyCode.RightArrow
}
}));
@editorAction
export class ReplCopyAllAction extends EditorAction {
constructor() {
......@@ -415,3 +396,20 @@ export class ReplCopyAllAction extends EditorAction {
clipboard.writeText(accessor.get(IPrivateReplService).getVisibleContent());
}
}
registerEditorAction(new ReplHistoryPreviousAction());
registerEditorAction(new ReplHistoryNextAction());
registerEditorAction(new AcceptReplInputAction());
registerEditorAction(new ReplCopyAllAction());
const SuggestCommand = EditorCommand.bindToContribution<SuggestController>(SuggestController.get);
CommonEditorRegistry.registerEditorCommand(new SuggestCommand({
id: 'repl.action.acceptSuggestion',
precondition: ContextKeyExpr.and(debug.CONTEXT_IN_DEBUG_REPL, SuggestContext.Visible),
handler: x => x.acceptSelectedSuggestion(),
kbOpts: {
weight: 50,
kbExpr: EditorContextKeys.textFocus,
primary: KeyCode.RightArrow
}
}));
......@@ -9,14 +9,12 @@ import nls = require('vs/nls');
import { TPromise } from 'vs/base/common/winjs.base';
import { ICommonCodeEditor } from 'vs/editor/common/editorCommon';
import { editorAction, EditorAction, ServicesAccessor } from 'vs/editor/common/editorCommonExtensions';
import { registerEditorAction, EditorAction, ServicesAccessor } from 'vs/editor/common/editorCommonExtensions';
import { IQuickOpenService } from 'vs/platform/quickOpen/common/quickOpen';
import { EditorContextKeys } from 'vs/editor/common/editorContextKeys';
const EMMET_COMMANDS_PREFIX = '>Emmet: ';
@editorAction
// @ts-ignore @editorAction uses the class
class ShowEmmetCommandsAction extends EditorAction {
constructor() {
......@@ -33,4 +31,6 @@ class ShowEmmetCommandsAction extends EditorAction {
quickOpenService.show(EMMET_COMMANDS_PREFIX);
return TPromise.as(null);
}
}
\ No newline at end of file
}
registerEditorAction(new ShowEmmetCommandsAction());
......@@ -6,13 +6,11 @@
'use strict';
import nls = require('vs/nls');
import { EmmetEditorAction } from 'vs/workbench/parts/emmet/electron-browser/emmetActions';
import { editorAction } from 'vs/editor/common/editorCommonExtensions';
import { registerEditorAction } from 'vs/editor/common/editorCommonExtensions';
import { EditorContextKeys } from 'vs/editor/common/editorContextKeys';
import { KeyCode } from 'vs/base/common/keyCodes';
import { ContextKeyExpr } from 'vs/platform/contextkey/common/contextkey';
@editorAction
// @ts-ignore @editorAction uses the class
class ExpandAbbreviationAction extends EmmetEditorAction {
constructor() {
......@@ -33,4 +31,6 @@ class ExpandAbbreviationAction extends EmmetEditorAction {
});
}
}
\ No newline at end of file
}
registerEditorAction(new ExpandAbbreviationAction());
......@@ -25,7 +25,7 @@ import { IMessageService, Severity, IMessageWithAction } from 'vs/platform/messa
import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry';
import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding';
import { IQuickOpenService } from 'vs/platform/quickOpen/common/quickOpen';
import { editorAction, EditorAction } from 'vs/editor/common/editorCommonExtensions';
import { registerEditorAction, EditorAction } from 'vs/editor/common/editorCommonExtensions';
import { IStorageService } from 'vs/platform/storage/common/storage';
import { ILifecycleService } from 'vs/platform/lifecycle/common/lifecycle';
import { once } from 'vs/base/common/event';
......@@ -173,8 +173,6 @@ export class ClearCommandHistoryAction extends Action {
}
}
@editorAction
// @ts-ignore @editorAction uses the class
class CommandPaletteEditorAction extends EditorAction {
constructor() {
......@@ -568,3 +566,5 @@ export class CommandsHandler extends QuickOpenHandler {
}
}
}
registerEditorAction(new CommandPaletteEditorAction());
......@@ -29,7 +29,7 @@ import { localize } from 'vs/nls';
import { Color, RGBA } from 'vs/base/common/color';
import { ICodeEditor, IEditorMouseEvent, MouseTargetType } from 'vs/editor/browser/editorBrowser';
import { editorContribution } from 'vs/editor/browser/editorBrowserExtensions';
import { editorAction, ServicesAccessor, EditorAction, CommonEditorRegistry } from 'vs/editor/common/editorCommonExtensions';
import { registerEditorAction, ServicesAccessor, EditorAction, CommonEditorRegistry } from 'vs/editor/common/editorCommonExtensions';
import { PeekViewWidget, getOuterEditor } from 'vs/editor/contrib/referenceSearch/browser/peekViewWidget';
import { IContextKeyService, IContextKey, ContextKeyExpr, RawContextKey } from 'vs/platform/contextkey/common/contextkey';
import { EditorContextKeys } from 'vs/editor/common/editorContextKeys';
......@@ -361,7 +361,6 @@ class DirtyDiffWidget extends PeekViewWidget {
}
}
@editorAction
export class ShowPreviousChangeAction extends EditorAction {
constructor() {
......@@ -394,8 +393,8 @@ export class ShowPreviousChangeAction extends EditorAction {
controller.previous();
}
}
registerEditorAction(new ShowPreviousChangeAction());
@editorAction
export class ShowNextChangeAction extends EditorAction {
constructor() {
......@@ -428,6 +427,7 @@ export class ShowNextChangeAction extends EditorAction {
controller.next();
}
}
registerEditorAction(new ShowNextChangeAction());
KeybindingsRegistry.registerCommandAndKeybindingRule({
id: 'closeDirtyDiff',
......
......@@ -7,7 +7,7 @@
import * as nls from 'vs/nls';
import { TPromise } from 'vs/base/common/winjs.base';
import { ICommonCodeEditor } from 'vs/editor/common/editorCommon';
import { editorAction, ServicesAccessor, EditorAction } from 'vs/editor/common/editorCommonExtensions';
import { registerEditorAction, ServicesAccessor, EditorAction } from 'vs/editor/common/editorCommonExtensions';
import { IQuickOpenService, IPickOpenEntry } from 'vs/platform/quickOpen/common/quickOpen';
import { IModeService } from 'vs/editor/common/services/modeService';
import { LanguageId } from 'vs/editor/common/modes';
......@@ -51,8 +51,6 @@ class Args {
}
@editorAction
// @ts-ignore @editorAction uses the class
class InsertSnippetAction extends EditorAction {
constructor() {
......@@ -142,6 +140,8 @@ class InsertSnippetAction extends EditorAction {
}
}
registerEditorAction(new InsertSnippetAction());
// compatibility command to make sure old keybinding are still working
CommandsRegistry.registerCommand('editor.action.showSnippets', accessor => {
return accessor.get(ICommandService).executeCommand('editor.action.insertSnippet');
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册