More cleanup around KbCtxKey
This commit is contained in:
parent
dd7c3d4ab0
commit
1a7ca5a77b
|
@ -47,6 +47,8 @@ import {ViewLinesViewportData} from 'vs/editor/common/viewLayout/viewLinesViewpo
|
|||
import {IRenderingContext} from 'vs/editor/common/view/renderingContext';
|
||||
import {IPointerHandlerHelper} from 'vs/editor/browser/controller/mouseHandler';
|
||||
|
||||
import EditorContextKeys = editorCommon.EditorContextKeys;
|
||||
|
||||
export class View extends ViewEventHandler implements editorBrowser.IView, IDisposable {
|
||||
|
||||
private eventDispatcher:ViewEventDispatcher;
|
||||
|
@ -174,7 +176,7 @@ export class View extends ViewEventHandler implements editorBrowser.IView, IDisp
|
|||
// Text Area (The focus will always be in the textarea when the cursor is blinking)
|
||||
this.textArea = <HTMLTextAreaElement>document.createElement('textarea');
|
||||
this._keybindingService = keybindingService.createScoped(this.textArea);
|
||||
this._editorTextFocusContextKey = editorCommon.KEYBINDING_CONTEXT_EDITOR_TEXT_FOCUS.bindTo(this._keybindingService);
|
||||
this._editorTextFocusContextKey = EditorContextKeys.TextFocus.bindTo(this._keybindingService);
|
||||
this.textArea.className = editorBrowser.ClassNames.TEXTAREA;
|
||||
this.textArea.setAttribute('wrap', 'off');
|
||||
this.textArea.setAttribute('autocorrect', 'off');
|
||||
|
|
|
@ -32,6 +32,8 @@ import {ViewModel} from 'vs/editor/common/viewModel/viewModelImpl';
|
|||
import {hash} from 'vs/base/common/hash';
|
||||
import {EditorModeContext} from 'vs/editor/common/modes/editorModeContext';
|
||||
|
||||
import EditorContextKeys = editorCommon.EditorContextKeys;
|
||||
|
||||
var EDITOR_ID = 0;
|
||||
|
||||
export abstract class CommonCodeEditor extends EventEmitter implements editorCommon.ICommonCodeEditor {
|
||||
|
@ -145,12 +147,12 @@ export abstract class CommonCodeEditor extends EventEmitter implements editorCom
|
|||
this._commandService = commandService;
|
||||
this._keybindingService = keybindingService;
|
||||
this._editorIdContextKey = this._keybindingService.createKey('editorId', this.getId());
|
||||
this._editorFocusContextKey = editorCommon.KEYBINDING_CONTEXT_EDITOR_FOCUS.bindTo(this._keybindingService);
|
||||
this._editorTabMovesFocusKey = editorCommon.KEYBINDING_CONTEXT_EDITOR_TAB_MOVES_FOCUS.bindTo(this._keybindingService);
|
||||
this._editorReadonly = editorCommon.KEYBINDING_CONTEXT_EDITOR_READONLY.bindTo(this._keybindingService);
|
||||
this._hasMultipleSelectionsKey = editorCommon.KEYBINDING_CONTEXT_EDITOR_HAS_MULTIPLE_SELECTIONS.bindTo(this._keybindingService);
|
||||
this._hasNonEmptySelectionKey = editorCommon.KEYBINDING_CONTEXT_EDITOR_HAS_NON_EMPTY_SELECTION.bindTo(this._keybindingService);
|
||||
this._langIdKey = editorCommon.KEYBINDING_CONTEXT_EDITOR_LANGUAGE_ID.bindTo(this._keybindingService);
|
||||
this._editorFocusContextKey = EditorContextKeys.Focus.bindTo(this._keybindingService);
|
||||
this._editorTabMovesFocusKey = EditorContextKeys.TabMovesFocus.bindTo(this._keybindingService);
|
||||
this._editorReadonly = EditorContextKeys.ReadOnly.bindTo(this._keybindingService);
|
||||
this._hasMultipleSelectionsKey = EditorContextKeys.HasMultipleSelections.bindTo(this._keybindingService);
|
||||
this._hasNonEmptySelectionKey = EditorContextKeys.HasNonEmptySelection.bindTo(this._keybindingService);
|
||||
this._langIdKey = EditorContextKeys.LanguageId.bindTo(this._keybindingService);
|
||||
this._lifetimeDispose.push(new EditorModeContext(this, this._keybindingService));
|
||||
|
||||
this._decorationTypeKeysToIds = {};
|
||||
|
|
|
@ -16,7 +16,7 @@ import {CommandsRegistry, ICommandHandler, ICommandHandlerDescription} from 'vs/
|
|||
|
||||
import H = editorCommon.Handler;
|
||||
import D = editorCommon.CommandDescription;
|
||||
import EditorKbExpr = editorCommon.EditorKbExpr;
|
||||
import EditorContextKeys = editorCommon.EditorContextKeys;
|
||||
|
||||
export interface IKeybindingsOptions {
|
||||
kbExpr?: KbExpr;
|
||||
|
@ -172,7 +172,7 @@ function registerCoreCommand(handlerId: string, kb: IKeybindings, weight?: numbe
|
|||
let command = new CoreCommand(
|
||||
handlerId,
|
||||
weight,
|
||||
when ? when : EditorKbExpr.TextFocus,
|
||||
when ? when : EditorContextKeys.TextFocus,
|
||||
kb
|
||||
);
|
||||
KeybindingsRegistry.registerCommandAndKeybindingRule(command.toCommandAndKeybindingRule(KeybindingsRegistry.WEIGHT.editorCore()));
|
||||
|
@ -378,14 +378,14 @@ registerCoreCommand(H.CursorColumnSelectPageDown, {
|
|||
registerCoreCommand(H.Tab, {
|
||||
primary: KeyCode.Tab
|
||||
}, KeybindingsRegistry.WEIGHT.editorCore(), KbExpr.and(
|
||||
EditorKbExpr.TextFocus,
|
||||
EditorKbExpr.TabDoesNotMoveFocus
|
||||
EditorContextKeys.TextFocus,
|
||||
EditorContextKeys.TabDoesNotMoveFocus
|
||||
));
|
||||
registerCoreCommand(H.Outdent, {
|
||||
primary: KeyMod.Shift | KeyCode.Tab
|
||||
}, KeybindingsRegistry.WEIGHT.editorCore(), KbExpr.and(
|
||||
EditorKbExpr.TextFocus,
|
||||
EditorKbExpr.TabDoesNotMoveFocus
|
||||
EditorContextKeys.TextFocus,
|
||||
EditorContextKeys.TabDoesNotMoveFocus
|
||||
));
|
||||
|
||||
registerCoreCommand(H.DeleteLeft, {
|
||||
|
@ -440,15 +440,15 @@ registerCoreCommand(H.CancelSelection, {
|
|||
primary: KeyCode.Escape,
|
||||
secondary: [KeyMod.Shift | KeyCode.Escape]
|
||||
}, KeybindingsRegistry.WEIGHT.editorCore(), KbExpr.and(
|
||||
EditorKbExpr.TextFocus,
|
||||
EditorKbExpr.HasNonEmptySelection
|
||||
EditorContextKeys.TextFocus,
|
||||
EditorContextKeys.HasNonEmptySelection
|
||||
));
|
||||
registerCoreCommand(H.RemoveSecondaryCursors, {
|
||||
primary: KeyCode.Escape,
|
||||
secondary: [KeyMod.Shift | KeyCode.Escape]
|
||||
}, KeybindingsRegistry.WEIGHT.editorCore(1), KbExpr.and(
|
||||
EditorKbExpr.TextFocus,
|
||||
EditorKbExpr.HasMultipleSelections
|
||||
EditorContextKeys.TextFocus,
|
||||
EditorContextKeys.HasMultipleSelections
|
||||
));
|
||||
|
||||
registerCoreCommand(H.CursorTop, {
|
||||
|
@ -515,6 +515,6 @@ KeybindingsRegistry.registerCommandAndKeybindingRule({
|
|||
id: 'editor.action.selectAll',
|
||||
handler: selectAll,
|
||||
weight: KeybindingsRegistry.WEIGHT.editorCore(),
|
||||
when: EditorKbExpr.TextFocus,
|
||||
when: EditorContextKeys.TextFocus,
|
||||
primary: KeyMod.CtrlCmd | KeyCode.KEY_A
|
||||
});
|
||||
|
|
|
@ -3018,79 +3018,66 @@ export interface IDiffLineInformation {
|
|||
}
|
||||
|
||||
/**
|
||||
* A context key that is set when the editor's text has focus (cursor is blinking).
|
||||
* @internal
|
||||
*/
|
||||
export const KEYBINDING_CONTEXT_EDITOR_TEXT_FOCUS = new KbCtxKey<boolean>('editorTextFocus', undefined);
|
||||
export namespace EditorContextKeys {
|
||||
/**
|
||||
* A context key that is set when the editor's text has focus (cursor is blinking).
|
||||
* @internal
|
||||
*/
|
||||
export const TextFocus = new KbCtxKey<boolean>('editorTextFocus', undefined);
|
||||
/**
|
||||
* A context key that is set when the editor's text or an editor's widget has focus.
|
||||
* @internal
|
||||
*/
|
||||
export const Focus = new KbCtxKey<boolean>('editorFocus', undefined);
|
||||
|
||||
/**
|
||||
* A context key that is set when the editor's text or an editor's widget has focus.
|
||||
* @internal
|
||||
*/
|
||||
export const KEYBINDING_CONTEXT_EDITOR_FOCUS = new KbCtxKey<boolean>('editorFocus', undefined);
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
export const KEYBINDING_CONTEXT_EDITOR_TAB_MOVES_FOCUS = new KbCtxKey<boolean>('editorTabMovesFocus', false);
|
||||
/**
|
||||
* A context key that is set when the editor's text is readonly.
|
||||
* @internal
|
||||
*/
|
||||
export const KEYBINDING_CONTEXT_EDITOR_READONLY = new KbCtxKey<boolean>('editorReadonly', false);
|
||||
/**
|
||||
* A context key that is set when the editor has multiple selections (multiple cursors).
|
||||
* @internal
|
||||
*/
|
||||
export const KEYBINDING_CONTEXT_EDITOR_HAS_MULTIPLE_SELECTIONS = new KbCtxKey<boolean>('editorHasMultipleSelections', false);
|
||||
/**
|
||||
* A context key that is set when the editor has a non-collapsed selection.
|
||||
* @internal
|
||||
*/
|
||||
export const KEYBINDING_CONTEXT_EDITOR_HAS_NON_EMPTY_SELECTION = new KbCtxKey<boolean>('editorHasSelection', false);
|
||||
/**
|
||||
* A context key that is set to the language associated with the model associated with the editor.
|
||||
* @internal
|
||||
*/
|
||||
export const KEYBINDING_CONTEXT_EDITOR_LANGUAGE_ID = new KbCtxKey<string>('editorLangId', undefined);
|
||||
/**
|
||||
* A context key that is set when the editor's text is readonly.
|
||||
* @internal
|
||||
*/
|
||||
export const ReadOnly = new KbCtxKey<boolean>('editorReadonly', false);
|
||||
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
export interface IEditorKbExpr {
|
||||
TextFocus: KbExpr;
|
||||
Focus: KbExpr;
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
export const Writable:KbExpr = ReadOnly.toNegated();
|
||||
|
||||
ReadOnly: KbExpr;
|
||||
Writable: KbExpr;
|
||||
/**
|
||||
* A context key that is set when the editor has a non-collapsed selection.
|
||||
* @internal
|
||||
*/
|
||||
export const HasNonEmptySelection = new KbCtxKey<boolean>('editorHasSelection', false);
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
export const HasOnlyEmptySelection:KbExpr = HasNonEmptySelection.toNegated();
|
||||
|
||||
HasNonEmptySelection: KbExpr;
|
||||
HasOnlyEmptySelection: KbExpr;
|
||||
/**
|
||||
* A context key that is set when the editor has multiple selections (multiple cursors).
|
||||
* @internal
|
||||
*/
|
||||
export const HasMultipleSelections = new KbCtxKey<boolean>('editorHasMultipleSelections', false);
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
export const HasSingleSelection:KbExpr = HasMultipleSelections.toNegated();
|
||||
|
||||
HasMultipleSelections: KbExpr;
|
||||
HasSingleSelection: KbExpr;
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
export const TabMovesFocus = new KbCtxKey<boolean>('editorTabMovesFocus', false);
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
export const TabDoesNotMoveFocus:KbExpr = TabMovesFocus.toNegated();
|
||||
|
||||
TabMovesFocus: KbExpr;
|
||||
TabDoesNotMoveFocus: KbExpr;
|
||||
}
|
||||
/**
|
||||
* A context key that is set to the language associated with the model associated with the editor.
|
||||
* @internal
|
||||
*/
|
||||
export const LanguageId = new KbCtxKey<string>('editorLangId', undefined);
|
||||
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
export let EditorKbExpr: IEditorKbExpr = {
|
||||
TextFocus: KEYBINDING_CONTEXT_EDITOR_TEXT_FOCUS,
|
||||
Focus: KEYBINDING_CONTEXT_EDITOR_FOCUS,
|
||||
|
||||
ReadOnly: KEYBINDING_CONTEXT_EDITOR_READONLY,
|
||||
Writable: KEYBINDING_CONTEXT_EDITOR_READONLY.toNegated(),
|
||||
|
||||
HasNonEmptySelection: KEYBINDING_CONTEXT_EDITOR_HAS_NON_EMPTY_SELECTION,
|
||||
HasOnlyEmptySelection: KEYBINDING_CONTEXT_EDITOR_HAS_NON_EMPTY_SELECTION.toNegated(),
|
||||
|
||||
HasMultipleSelections: KEYBINDING_CONTEXT_EDITOR_HAS_MULTIPLE_SELECTIONS,
|
||||
HasSingleSelection: KEYBINDING_CONTEXT_EDITOR_HAS_MULTIPLE_SELECTIONS.toNegated(),
|
||||
|
||||
TabMovesFocus: KEYBINDING_CONTEXT_EDITOR_TAB_MOVES_FOCUS,
|
||||
TabDoesNotMoveFocus: KEYBINDING_CONTEXT_EDITOR_TAB_MOVES_FOCUS.toNegated(),
|
||||
};
|
||||
|
||||
|
||||
|
|
|
@ -18,7 +18,7 @@ import {ServicesAccessor} from 'vs/platform/instantiation/common/instantiation';
|
|||
import {KbExpr, KbCtxKey, IKeybindingContextKey, IKeybindingService} from 'vs/platform/keybinding/common/keybinding';
|
||||
import {KeybindingsRegistry} from 'vs/platform/keybinding/common/keybindingsRegistry';
|
||||
import {GlobalScreenReaderNVDA} from 'vs/editor/common/config/commonEditorConfig';
|
||||
import {ICommonCodeEditor, IEditorContribution, EditorKbExpr} from 'vs/editor/common/editorCommon';
|
||||
import {ICommonCodeEditor, IEditorContribution, EditorContextKeys} from 'vs/editor/common/editorCommon';
|
||||
import {CommonEditorRegistry, EditorAction, EditorCommand, Command} from 'vs/editor/common/editorCommonExtensions';
|
||||
import {ICodeEditor, IOverlayWidget, IOverlayWidgetPosition} from 'vs/editor/browser/editorBrowser';
|
||||
import {EditorBrowserRegistry} from 'vs/editor/browser/editorBrowserExtensions';
|
||||
|
@ -200,7 +200,7 @@ class ShowAccessibilityHelpAction extends EditorAction {
|
|||
);
|
||||
|
||||
this.kbOpts = {
|
||||
kbExpr: EditorKbExpr.Focus,
|
||||
kbExpr: EditorContextKeys.Focus,
|
||||
primary: KeyMod.Alt | KeyCode.F1
|
||||
};
|
||||
}
|
||||
|
@ -218,7 +218,7 @@ const AccessibilityHelpCommand = EditorCommand.bindToContribution<AccessibilityH
|
|||
AccessibilityHelpController.get,
|
||||
{
|
||||
weight: CommonEditorRegistry.commandWeight(100),
|
||||
kbExpr: KbExpr.and(EditorKbExpr.Focus, CONTEXT_ACCESSIBILITY_WIDGET_VISIBLE)
|
||||
kbExpr: KbExpr.and(EditorContextKeys.Focus, CONTEXT_ACCESSIBILITY_WIDGET_VISIBLE)
|
||||
}
|
||||
);
|
||||
|
||||
|
|
|
@ -16,7 +16,7 @@ import * as editorCommon from 'vs/editor/common/editorCommon';
|
|||
import {EditorAction, CommonEditorRegistry} from 'vs/editor/common/editorCommonExtensions';
|
||||
import {MenuId} from 'vs/platform/actions/common/actions';
|
||||
|
||||
import EditorKbExpr = editorCommon.EditorKbExpr;
|
||||
import EditorContextKeys = editorCommon.EditorContextKeys;
|
||||
|
||||
const CLIPBOARD_CONTEXT_MENU_GROUP = '9_cutcopypaste';
|
||||
|
||||
|
@ -87,13 +87,13 @@ class ExecCommandCutAction extends ClipboardWritingAction {
|
|||
);
|
||||
|
||||
this.kbOpts = {
|
||||
kbExpr: KbExpr.and(EditorKbExpr.TextFocus, EditorKbExpr.Writable),
|
||||
kbExpr: KbExpr.and(EditorContextKeys.TextFocus, EditorContextKeys.Writable),
|
||||
primary: KeyMod.CtrlCmd | KeyCode.KEY_X,
|
||||
win: { primary: KeyMod.CtrlCmd | KeyCode.KEY_X, secondary: [KeyMod.Shift | KeyCode.Delete] }
|
||||
};
|
||||
|
||||
this.menuOpts = {
|
||||
kbExpr: EditorKbExpr.Writable,
|
||||
kbExpr: EditorContextKeys.Writable,
|
||||
menu: MenuId.EditorContext,
|
||||
group: CLIPBOARD_CONTEXT_MENU_GROUP,
|
||||
order: 1
|
||||
|
@ -120,7 +120,7 @@ class ExecCommandCopyAction extends ClipboardWritingAction {
|
|||
);
|
||||
|
||||
this.kbOpts = {
|
||||
kbExpr: EditorKbExpr.TextFocus,
|
||||
kbExpr: EditorContextKeys.TextFocus,
|
||||
primary: KeyMod.CtrlCmd | KeyCode.KEY_C,
|
||||
win: { primary: KeyMod.CtrlCmd | KeyCode.KEY_C, secondary: [KeyMod.CtrlCmd | KeyCode.Insert] }
|
||||
};
|
||||
|
@ -146,13 +146,13 @@ class ExecCommandPasteAction extends ExecCommandAction {
|
|||
);
|
||||
|
||||
this.kbOpts = {
|
||||
kbExpr: KbExpr.and(EditorKbExpr.TextFocus, EditorKbExpr.Writable),
|
||||
kbExpr: KbExpr.and(EditorContextKeys.TextFocus, EditorContextKeys.Writable),
|
||||
primary: KeyMod.CtrlCmd | KeyCode.KEY_V,
|
||||
win: { primary: KeyMod.CtrlCmd | KeyCode.KEY_V, secondary: [KeyMod.Shift | KeyCode.Insert] }
|
||||
};
|
||||
|
||||
this.menuOpts = {
|
||||
kbExpr: EditorKbExpr.Writable,
|
||||
kbExpr: EditorContextKeys.Writable,
|
||||
menu: MenuId.EditorContext,
|
||||
group: CLIPBOARD_CONTEXT_MENU_GROUP,
|
||||
order: 3
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
|
||||
import * as nls from 'vs/nls';
|
||||
import {KeyCode, KeyMod} from 'vs/base/common/keyCodes';
|
||||
import {ICommand, ICommonCodeEditor, EditorKbExpr} from 'vs/editor/common/editorCommon';
|
||||
import {ICommand, ICommonCodeEditor, EditorContextKeys} from 'vs/editor/common/editorCommon';
|
||||
import {EditorAction, CommonEditorRegistry, ServicesAccessor} from 'vs/editor/common/editorCommonExtensions';
|
||||
import {BlockCommentCommand} from './blockCommentCommand';
|
||||
import {LineCommentCommand, Type} from './lineCommentCommand';
|
||||
|
@ -51,7 +51,7 @@ class ToggleCommentLineAction extends CommentLineAction {
|
|||
);
|
||||
|
||||
this.kbOpts = {
|
||||
kbExpr: KbExpr.and(EditorKbExpr.TextFocus, EditorKbExpr.Writable),
|
||||
kbExpr: KbExpr.and(EditorContextKeys.TextFocus, EditorContextKeys.Writable),
|
||||
primary: KeyMod.CtrlCmd | KeyCode.US_SLASH
|
||||
};
|
||||
}
|
||||
|
@ -68,7 +68,7 @@ class AddLineCommentAction extends CommentLineAction {
|
|||
);
|
||||
|
||||
this.kbOpts = {
|
||||
kbExpr: KbExpr.and(EditorKbExpr.TextFocus, EditorKbExpr.Writable),
|
||||
kbExpr: KbExpr.and(EditorContextKeys.TextFocus, EditorContextKeys.Writable),
|
||||
primary: KeyMod.chord(KeyMod.CtrlCmd | KeyCode.KEY_K, KeyMod.CtrlCmd | KeyCode.KEY_C)
|
||||
};
|
||||
}
|
||||
|
@ -85,7 +85,7 @@ class RemoveLineCommentAction extends CommentLineAction {
|
|||
);
|
||||
|
||||
this.kbOpts = {
|
||||
kbExpr: KbExpr.and(EditorKbExpr.TextFocus, EditorKbExpr.Writable),
|
||||
kbExpr: KbExpr.and(EditorContextKeys.TextFocus, EditorContextKeys.Writable),
|
||||
primary: KeyMod.chord(KeyMod.CtrlCmd | KeyCode.KEY_K, KeyMod.CtrlCmd | KeyCode.KEY_U)
|
||||
};
|
||||
}
|
||||
|
@ -102,7 +102,7 @@ class BlockCommentAction extends EditorAction {
|
|||
);
|
||||
|
||||
this.kbOpts = {
|
||||
kbExpr: KbExpr.and(EditorKbExpr.TextFocus, EditorKbExpr.Writable),
|
||||
kbExpr: KbExpr.and(EditorContextKeys.TextFocus, EditorContextKeys.Writable),
|
||||
primary: KeyMod.Shift | KeyMod.Alt | KeyCode.KEY_A,
|
||||
linux: { primary: KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.KEY_A }
|
||||
};
|
||||
|
|
|
@ -15,7 +15,7 @@ import {ActionItem, Separator} from 'vs/base/browser/ui/actionbar/actionbar';
|
|||
import {IContextMenuService, IContextViewService} from 'vs/platform/contextview/browser/contextView';
|
||||
import {IKeybindingService} from 'vs/platform/keybinding/common/keybinding';
|
||||
import {IMenuService, IMenu, MenuId} from 'vs/platform/actions/common/actions';
|
||||
import {ICommonCodeEditor, IEditorContribution, MouseTargetType, EditorKbExpr} from 'vs/editor/common/editorCommon';
|
||||
import {ICommonCodeEditor, IEditorContribution, MouseTargetType, EditorContextKeys} from 'vs/editor/common/editorCommon';
|
||||
import {ServicesAccessor, EditorAction, CommonEditorRegistry} from 'vs/editor/common/editorCommonExtensions';
|
||||
import {ICodeEditor, IEditorMouseEvent} from 'vs/editor/browser/editorBrowser';
|
||||
import {EditorBrowserRegistry} from 'vs/editor/browser/editorBrowserExtensions';
|
||||
|
@ -229,7 +229,7 @@ class ShowContextMenu extends EditorAction {
|
|||
);
|
||||
|
||||
this.kbOpts = {
|
||||
kbExpr: EditorKbExpr.TextFocus,
|
||||
kbExpr: EditorContextKeys.TextFocus,
|
||||
primary: KeyMod.Shift | KeyCode.F10
|
||||
};
|
||||
}
|
||||
|
|
|
@ -25,7 +25,7 @@ import {EditorBrowserRegistry} from 'vs/editor/browser/editorBrowserExtensions';
|
|||
import {CodeSnippet, getSnippetController} from 'vs/editor/contrib/snippet/common/snippet';
|
||||
import {SmartSnippetInserter} from 'vs/editor/contrib/defineKeybinding/common/smartSnippetInserter';
|
||||
|
||||
import EditorKbExpr = editorCommon.EditorKbExpr;
|
||||
import EditorContextKeys = editorCommon.EditorContextKeys;
|
||||
|
||||
const NLS_LAUNCH_MESSAGE = nls.localize('defineKeybinding.start', "Define Keybinding");
|
||||
const NLS_DEFINE_MESSAGE = nls.localize('defineKeybinding.initial', "Press desired key combination and ENTER");
|
||||
|
@ -458,7 +458,7 @@ export class DefineKeybindingAction extends EditorAction {
|
|||
);
|
||||
|
||||
this.kbOpts = {
|
||||
kbExpr: EditorKbExpr.Focus,
|
||||
kbExpr: EditorContextKeys.Focus,
|
||||
primary: KeyMod.chord(KeyMod.CtrlCmd | KeyCode.KEY_K, KeyMod.CtrlCmd | KeyCode.KEY_K)
|
||||
};
|
||||
}
|
||||
|
|
|
@ -18,7 +18,7 @@ import {FindReplaceState, FindReplaceStateChangedEvent, INewFindReplaceState} fr
|
|||
import {DocumentHighlightProviderRegistry} from 'vs/editor/common/modes';
|
||||
import {RunOnceScheduler} from 'vs/base/common/async';
|
||||
|
||||
import EditorKbExpr = editorCommon.EditorKbExpr;
|
||||
import EditorContextKeys = editorCommon.EditorContextKeys;
|
||||
|
||||
export enum FindStartFocusAction {
|
||||
NoFocusChange,
|
||||
|
@ -291,7 +291,7 @@ export class NextMatchFindAction extends MatchFindAction {
|
|||
);
|
||||
|
||||
this.kbOpts = {
|
||||
kbExpr: EditorKbExpr.Focus,
|
||||
kbExpr: EditorContextKeys.Focus,
|
||||
primary: KeyCode.F3,
|
||||
mac: { primary: KeyMod.CtrlCmd | KeyCode.KEY_G, secondary: [KeyCode.F3] }
|
||||
};
|
||||
|
@ -312,7 +312,7 @@ export class PreviousMatchFindAction extends MatchFindAction {
|
|||
);
|
||||
|
||||
this.kbOpts = {
|
||||
kbExpr: EditorKbExpr.Focus,
|
||||
kbExpr: EditorContextKeys.Focus,
|
||||
primary: KeyMod.Shift | KeyCode.F3,
|
||||
mac: { primary: KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.KEY_G, secondary: [KeyMod.Shift | KeyCode.F3] }
|
||||
};
|
||||
|
@ -359,7 +359,7 @@ export class NextSelectionMatchFindAction extends SelectionMatchFindAction {
|
|||
);
|
||||
|
||||
this.kbOpts = {
|
||||
kbExpr: EditorKbExpr.Focus,
|
||||
kbExpr: EditorContextKeys.Focus,
|
||||
primary: KeyMod.CtrlCmd | KeyCode.F3
|
||||
};
|
||||
}
|
||||
|
@ -379,7 +379,7 @@ export class PreviousSelectionMatchFindAction extends SelectionMatchFindAction {
|
|||
);
|
||||
|
||||
this.kbOpts = {
|
||||
kbExpr: EditorKbExpr.Focus,
|
||||
kbExpr: EditorContextKeys.Focus,
|
||||
primary: KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.F3
|
||||
};
|
||||
}
|
||||
|
@ -541,7 +541,7 @@ export class AddSelectionToNextFindMatchAction extends SelectNextFindMatchAction
|
|||
);
|
||||
|
||||
this.kbOpts = {
|
||||
kbExpr: EditorKbExpr.Focus,
|
||||
kbExpr: EditorContextKeys.Focus,
|
||||
primary: KeyMod.CtrlCmd | KeyCode.KEY_D
|
||||
};
|
||||
}
|
||||
|
@ -592,7 +592,7 @@ export class MoveSelectionToNextFindMatchAction extends SelectNextFindMatchActio
|
|||
);
|
||||
|
||||
this.kbOpts = {
|
||||
kbExpr: EditorKbExpr.Focus,
|
||||
kbExpr: EditorContextKeys.Focus,
|
||||
primary: KeyMod.chord(KeyMod.CtrlCmd | KeyCode.KEY_K, KeyMod.CtrlCmd | KeyCode.KEY_D)
|
||||
};
|
||||
}
|
||||
|
@ -675,7 +675,7 @@ export class SelectHighlightsAction extends AbstractSelectHighlightsAction {
|
|||
);
|
||||
|
||||
this.kbOpts = {
|
||||
kbExpr: EditorKbExpr.Focus,
|
||||
kbExpr: EditorContextKeys.Focus,
|
||||
primary: KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.KEY_L
|
||||
};
|
||||
}
|
||||
|
@ -690,14 +690,14 @@ export class CompatChangeAll extends AbstractSelectHighlightsAction {
|
|||
);
|
||||
|
||||
this.kbOpts = {
|
||||
kbExpr: EditorKbExpr.TextFocus,
|
||||
kbExpr: EditorContextKeys.TextFocus,
|
||||
primary: KeyMod.CtrlCmd | KeyCode.F2
|
||||
};
|
||||
|
||||
this.menuOpts = {
|
||||
group: '1_modification',
|
||||
order: 1.2,
|
||||
kbExpr: EditorKbExpr.Writable
|
||||
kbExpr: EditorContextKeys.Writable
|
||||
};
|
||||
}
|
||||
}
|
||||
|
@ -879,14 +879,14 @@ CommonEditorRegistry.registerEditorAction(new AddSelectionToPreviousFindMatchAct
|
|||
const FindCommand = EditorCommand.bindToContribution<CommonFindController>(
|
||||
CommonFindController.getFindController, {
|
||||
weight: CommonEditorRegistry.commandWeight(5),
|
||||
kbExpr: EditorKbExpr.Focus
|
||||
kbExpr: EditorContextKeys.Focus
|
||||
}
|
||||
);
|
||||
|
||||
const VisibleWidgetFindCommand = EditorCommand.bindToContribution(
|
||||
CommonFindController.getFindController, {
|
||||
weight: CommonEditorRegistry.commandWeight(5),
|
||||
kbExpr: KbExpr.and(EditorKbExpr.Focus, CONTEXT_FIND_WIDGET_VISIBLE)
|
||||
kbExpr: KbExpr.and(EditorContextKeys.Focus, CONTEXT_FIND_WIDGET_VISIBLE)
|
||||
}
|
||||
);
|
||||
|
||||
|
|
|
@ -20,7 +20,7 @@ import {IFoldingRange} from 'vs/editor/contrib/folding/common/foldingRange';
|
|||
import {computeRanges, limitByIndent} from 'vs/editor/contrib/folding/common/indentFoldStrategy';
|
||||
import {Selection} from 'vs/editor/common/core/selection';
|
||||
|
||||
import EditorKbExpr = editorCommon.EditorKbExpr;
|
||||
import EditorContextKeys = editorCommon.EditorContextKeys;
|
||||
|
||||
class CollapsibleRegion {
|
||||
|
||||
|
@ -654,7 +654,7 @@ abstract class FoldingAction2 extends EditorAction {
|
|||
super(id, label, alias, false);
|
||||
|
||||
this.kbOpts = {
|
||||
kbExpr: EditorKbExpr.Focus,
|
||||
kbExpr: EditorContextKeys.Focus,
|
||||
primary: keybinding
|
||||
};
|
||||
}
|
||||
|
|
|
@ -18,7 +18,7 @@ import {EditOperationsCommand} from './formatCommand';
|
|||
import {Selection} from 'vs/editor/common/core/selection';
|
||||
|
||||
import ModeContextKeys = editorCommon.ModeContextKeys;
|
||||
import EditorKbExpr = editorCommon.EditorKbExpr;
|
||||
import EditorContextKeys = editorCommon.EditorContextKeys;
|
||||
|
||||
class FormatOnType implements editorCommon.IEditorContribution {
|
||||
|
||||
|
@ -146,7 +146,7 @@ export class FormatAction extends EditorAction {
|
|||
);
|
||||
|
||||
this.kbOpts = {
|
||||
kbExpr: KbExpr.and(EditorKbExpr.TextFocus, EditorKbExpr.Writable),
|
||||
kbExpr: KbExpr.and(EditorContextKeys.TextFocus, EditorContextKeys.Writable),
|
||||
primary: KeyMod.Shift | KeyMod.Alt | KeyCode.KEY_F,
|
||||
linux: { primary: KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.KEY_I }
|
||||
};
|
||||
|
|
|
@ -33,7 +33,7 @@ import {IPeekViewService} from 'vs/editor/contrib/zoneWidget/browser/peekViewWid
|
|||
import {optional} from 'vs/platform/instantiation/common/instantiation';
|
||||
|
||||
import ModeContextKeys = editorCommon.ModeContextKeys;
|
||||
import EditorKbExpr = editorCommon.EditorKbExpr;
|
||||
import EditorContextKeys = editorCommon.EditorContextKeys;
|
||||
|
||||
export class DefinitionActionConfig {
|
||||
|
||||
|
@ -173,7 +173,7 @@ export class GoToDefinitionAction extends DefinitionAction {
|
|||
);
|
||||
|
||||
this.kbOpts = {
|
||||
kbExpr: EditorKbExpr.TextFocus,
|
||||
kbExpr: EditorContextKeys.TextFocus,
|
||||
primary: goToDeclarationKb
|
||||
};
|
||||
|
||||
|
@ -198,7 +198,7 @@ export class OpenDefinitionToSideAction extends DefinitionAction {
|
|||
);
|
||||
|
||||
this.kbOpts = {
|
||||
kbExpr: EditorKbExpr.TextFocus,
|
||||
kbExpr: EditorContextKeys.TextFocus,
|
||||
primary: KeyMod.chord(KeyMod.CtrlCmd | KeyCode.KEY_K, goToDeclarationKb)
|
||||
};
|
||||
}
|
||||
|
@ -215,7 +215,7 @@ export class PeekDefinitionAction extends DefinitionAction {
|
|||
);
|
||||
|
||||
this.kbOpts = {
|
||||
kbExpr: EditorKbExpr.TextFocus,
|
||||
kbExpr: EditorContextKeys.TextFocus,
|
||||
primary: KeyMod.Alt | KeyCode.F12,
|
||||
linux: { primary: KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.F10 }
|
||||
};
|
||||
|
|
|
@ -29,7 +29,7 @@ import {EditorBrowserRegistry} from 'vs/editor/browser/editorBrowserExtensions';
|
|||
import {ZoneWidget} from 'vs/editor/contrib/zoneWidget/browser/zoneWidget';
|
||||
import {getCodeActions, IQuickFix2} from 'vs/editor/contrib/quickFix/common/quickFix';
|
||||
|
||||
import EditorKbExpr = editorCommon.EditorKbExpr;
|
||||
import EditorContextKeys = editorCommon.EditorContextKeys;
|
||||
|
||||
class MarkerModel {
|
||||
|
||||
|
@ -522,7 +522,7 @@ class NextMarkerAction extends MarkerNavigationAction {
|
|||
);
|
||||
|
||||
this.kbOpts = {
|
||||
kbExpr: EditorKbExpr.Focus,
|
||||
kbExpr: EditorContextKeys.Focus,
|
||||
primary: KeyCode.F8
|
||||
};
|
||||
}
|
||||
|
@ -538,7 +538,7 @@ class PrevMarkerAction extends MarkerNavigationAction {
|
|||
);
|
||||
|
||||
this.kbOpts = {
|
||||
kbExpr: EditorKbExpr.Focus,
|
||||
kbExpr: EditorContextKeys.Focus,
|
||||
primary: KeyMod.Shift | KeyCode.F8
|
||||
};
|
||||
}
|
||||
|
@ -549,7 +549,7 @@ var CONTEXT_MARKERS_NAVIGATION_VISIBLE = new KbCtxKey<boolean>('markersNavigatio
|
|||
const MarkerCommand = EditorCommand.bindToContribution<MarkerController>(
|
||||
MarkerController.getMarkerController, {
|
||||
weight: CommonEditorRegistry.commandWeight(50),
|
||||
kbExpr: KbExpr.and(EditorKbExpr.Focus, CONTEXT_MARKERS_NAVIGATION_VISIBLE)
|
||||
kbExpr: KbExpr.and(EditorContextKeys.Focus, CONTEXT_MARKERS_NAVIGATION_VISIBLE)
|
||||
}
|
||||
);
|
||||
|
||||
|
|
|
@ -21,7 +21,7 @@ import {ModesContentHoverWidget} from './modesContentHover';
|
|||
import {ModesGlyphHoverWidget} from './modesGlyphHover';
|
||||
import {IDisposable, dispose} from 'vs/base/common/lifecycle';
|
||||
|
||||
import EditorKbExpr = editorCommon.EditorKbExpr;
|
||||
import EditorContextKeys = editorCommon.EditorContextKeys;
|
||||
|
||||
class ModesHoverController implements editorCommon.IEditorContribution {
|
||||
|
||||
|
@ -154,7 +154,7 @@ class ShowHoverAction extends EditorAction {
|
|||
);
|
||||
|
||||
this.kbOpts = {
|
||||
kbExpr: EditorKbExpr.TextFocus,
|
||||
kbExpr: EditorContextKeys.TextFocus,
|
||||
primary: KeyMod.chord(KeyMod.CtrlCmd | KeyCode.KEY_K, KeyMod.CtrlCmd | KeyCode.KEY_I)
|
||||
};
|
||||
}
|
||||
|
|
|
@ -8,7 +8,7 @@ import * as nls from 'vs/nls';
|
|||
import {KeyCode, KeyMod} from 'vs/base/common/keyCodes';
|
||||
import {TPromise} from 'vs/base/common/winjs.base';
|
||||
import {Range} from 'vs/editor/common/core/range';
|
||||
import {EditorKbExpr, IEditorContribution, CodeEditorStateFlag, ICommonCodeEditor, IModelDecorationsChangeAccessor} from 'vs/editor/common/editorCommon';
|
||||
import {EditorContextKeys, IEditorContribution, CodeEditorStateFlag, ICommonCodeEditor, IModelDecorationsChangeAccessor} from 'vs/editor/common/editorCommon';
|
||||
import {ServicesAccessor, EditorAction, CommonEditorRegistry} from 'vs/editor/common/editorCommonExtensions';
|
||||
import {IInplaceReplaceSupportResult} from 'vs/editor/common/modes';
|
||||
import {IEditorWorkerService} from 'vs/editor/common/services/editorWorkerService';
|
||||
|
@ -136,7 +136,7 @@ class InPlaceReplaceUp extends EditorAction {
|
|||
);
|
||||
|
||||
this.kbOpts = {
|
||||
kbExpr: EditorKbExpr.TextFocus,
|
||||
kbExpr: EditorContextKeys.TextFocus,
|
||||
primary: KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.US_COMMA
|
||||
};
|
||||
}
|
||||
|
@ -157,7 +157,7 @@ class InPlaceReplaceDown extends EditorAction {
|
|||
);
|
||||
|
||||
this.kbOpts = {
|
||||
kbExpr: EditorKbExpr.TextFocus,
|
||||
kbExpr: EditorContextKeys.TextFocus,
|
||||
primary: KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.US_DOT
|
||||
};
|
||||
}
|
||||
|
|
|
@ -8,7 +8,7 @@ import * as nls from 'vs/nls';
|
|||
import {KeyCode, KeyMod} from 'vs/base/common/keyCodes';
|
||||
import {SortLinesCommand} from 'vs/editor/contrib/linesOperations/common/sortLinesCommand';
|
||||
import {TrimTrailingWhitespaceCommand} from 'vs/editor/common/commands/trimTrailingWhitespaceCommand';
|
||||
import {EditorKbExpr, Handler, ICommand, ICommonCodeEditor} from 'vs/editor/common/editorCommon';
|
||||
import {EditorContextKeys, Handler, ICommand, ICommonCodeEditor} from 'vs/editor/common/editorCommon';
|
||||
import {ServicesAccessor, EditorAction, HandlerEditorAction, CommonEditorRegistry} from 'vs/editor/common/editorCommonExtensions';
|
||||
import {CopyLinesCommand} from './copyLinesCommand';
|
||||
import {DeleteLinesCommand} from './deleteLinesCommand';
|
||||
|
@ -48,7 +48,7 @@ class CopyLinesUpAction extends AbstractCopyLinesAction {
|
|||
);
|
||||
|
||||
this.kbOpts = {
|
||||
kbExpr: EditorKbExpr.TextFocus,
|
||||
kbExpr: EditorContextKeys.TextFocus,
|
||||
primary: KeyMod.Alt | KeyMod.Shift | KeyCode.UpArrow,
|
||||
linux: { primary: KeyMod.CtrlCmd | KeyMod.Alt | KeyMod.Shift | KeyCode.UpArrow }
|
||||
};
|
||||
|
@ -65,7 +65,7 @@ class CopyLinesDownAction extends AbstractCopyLinesAction {
|
|||
);
|
||||
|
||||
this.kbOpts = {
|
||||
kbExpr: EditorKbExpr.TextFocus,
|
||||
kbExpr: EditorContextKeys.TextFocus,
|
||||
primary: KeyMod.Alt | KeyMod.Shift | KeyCode.DownArrow,
|
||||
linux: { primary: KeyMod.CtrlCmd | KeyMod.Alt | KeyMod.Shift | KeyCode.DownArrow }
|
||||
};
|
||||
|
@ -106,7 +106,7 @@ class MoveLinesUpAction extends AbstractMoveLinesAction {
|
|||
);
|
||||
|
||||
this.kbOpts = {
|
||||
kbExpr: EditorKbExpr.TextFocus,
|
||||
kbExpr: EditorContextKeys.TextFocus,
|
||||
primary: KeyMod.Alt | KeyCode.UpArrow,
|
||||
linux: { primary: KeyMod.Alt | KeyCode.UpArrow }
|
||||
};
|
||||
|
@ -123,7 +123,7 @@ class MoveLinesDownAction extends AbstractMoveLinesAction {
|
|||
);
|
||||
|
||||
this.kbOpts = {
|
||||
kbExpr: EditorKbExpr.TextFocus,
|
||||
kbExpr: EditorContextKeys.TextFocus,
|
||||
primary: KeyMod.Alt | KeyCode.DownArrow,
|
||||
linux: { primary: KeyMod.Alt | KeyCode.DownArrow }
|
||||
};
|
||||
|
@ -160,7 +160,7 @@ class SortLinesAscendingAction extends AbstractSortLinesAction {
|
|||
);
|
||||
|
||||
this.kbOpts = {
|
||||
kbExpr: EditorKbExpr.TextFocus,
|
||||
kbExpr: EditorContextKeys.TextFocus,
|
||||
primary: KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.KEY_2
|
||||
};
|
||||
}
|
||||
|
@ -176,7 +176,7 @@ class SortLinesDescendingAction extends AbstractSortLinesAction {
|
|||
);
|
||||
|
||||
this.kbOpts = {
|
||||
kbExpr: EditorKbExpr.TextFocus,
|
||||
kbExpr: EditorContextKeys.TextFocus,
|
||||
primary: KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.KEY_3
|
||||
};
|
||||
}
|
||||
|
@ -195,7 +195,7 @@ export class TrimTrailingWhitespaceAction extends EditorAction {
|
|||
);
|
||||
|
||||
this.kbOpts = {
|
||||
kbExpr: EditorKbExpr.TextFocus,
|
||||
kbExpr: EditorContextKeys.TextFocus,
|
||||
primary: KeyMod.chord(KeyMod.CtrlCmd | KeyCode.KEY_K, KeyMod.CtrlCmd | KeyCode.KEY_X)
|
||||
};
|
||||
}
|
||||
|
@ -274,7 +274,7 @@ class DeleteLinesAction extends AbstractRemoveLinesAction {
|
|||
);
|
||||
|
||||
this.kbOpts = {
|
||||
kbExpr: EditorKbExpr.TextFocus,
|
||||
kbExpr: EditorContextKeys.TextFocus,
|
||||
primary: KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.KEY_K
|
||||
};
|
||||
}
|
||||
|
@ -303,7 +303,7 @@ class IndentLinesAction extends HandlerEditorAction {
|
|||
);
|
||||
|
||||
this.kbOpts = {
|
||||
kbExpr: EditorKbExpr.TextFocus,
|
||||
kbExpr: EditorContextKeys.TextFocus,
|
||||
primary: KeyMod.CtrlCmd | KeyCode.US_CLOSE_SQUARE_BRACKET
|
||||
};
|
||||
}
|
||||
|
@ -320,7 +320,7 @@ class OutdentLinesAction extends HandlerEditorAction {
|
|||
);
|
||||
|
||||
this.kbOpts = {
|
||||
kbExpr: EditorKbExpr.TextFocus,
|
||||
kbExpr: EditorContextKeys.TextFocus,
|
||||
primary: KeyMod.CtrlCmd | KeyCode.US_OPEN_SQUARE_BRACKET
|
||||
};
|
||||
}
|
||||
|
@ -337,7 +337,7 @@ class InsertLineBeforeAction extends HandlerEditorAction {
|
|||
);
|
||||
|
||||
this.kbOpts = {
|
||||
kbExpr: EditorKbExpr.TextFocus,
|
||||
kbExpr: EditorContextKeys.TextFocus,
|
||||
primary: KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.Enter
|
||||
};
|
||||
}
|
||||
|
@ -354,7 +354,7 @@ class InsertLineAfterAction extends HandlerEditorAction {
|
|||
);
|
||||
|
||||
this.kbOpts = {
|
||||
kbExpr: EditorKbExpr.TextFocus,
|
||||
kbExpr: EditorContextKeys.TextFocus,
|
||||
primary: KeyMod.CtrlCmd | KeyCode.Enter
|
||||
};
|
||||
}
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
|
||||
import * as nls from 'vs/nls';
|
||||
import {KeyCode, KeyMod} from 'vs/base/common/keyCodes';
|
||||
import {Handler, ICommonCodeEditor, EditorKbExpr, ISelection} from 'vs/editor/common/editorCommon';
|
||||
import {Handler, ICommonCodeEditor, EditorContextKeys, ISelection} from 'vs/editor/common/editorCommon';
|
||||
import {ServicesAccessor, EditorAction, HandlerEditorAction, CommonEditorRegistry} from 'vs/editor/common/editorCommonExtensions';
|
||||
|
||||
class InsertCursorAbove extends HandlerEditorAction {
|
||||
|
@ -20,7 +20,7 @@ class InsertCursorAbove extends HandlerEditorAction {
|
|||
);
|
||||
|
||||
this.kbOpts = {
|
||||
kbExpr: EditorKbExpr.TextFocus,
|
||||
kbExpr: EditorContextKeys.TextFocus,
|
||||
primary: KeyMod.CtrlCmd | KeyMod.Alt | KeyCode.UpArrow,
|
||||
linux: {
|
||||
primary: KeyMod.Shift | KeyMod.Alt | KeyCode.UpArrow,
|
||||
|
@ -41,7 +41,7 @@ class InsertCursorBelow extends HandlerEditorAction {
|
|||
);
|
||||
|
||||
this.kbOpts = {
|
||||
kbExpr: EditorKbExpr.TextFocus,
|
||||
kbExpr: EditorContextKeys.TextFocus,
|
||||
primary: KeyMod.CtrlCmd | KeyMod.Alt | KeyCode.DownArrow,
|
||||
linux: {
|
||||
primary: KeyMod.Shift | KeyMod.Alt | KeyCode.DownArrow,
|
||||
|
@ -62,7 +62,7 @@ class InsertCursorAtEndOfEachLineSelected extends EditorAction {
|
|||
);
|
||||
|
||||
this.kbOpts = {
|
||||
kbExpr: EditorKbExpr.TextFocus,
|
||||
kbExpr: EditorContextKeys.TextFocus,
|
||||
primary: KeyMod.Shift | KeyMod.Alt | KeyCode.KEY_I
|
||||
};
|
||||
}
|
||||
|
|
|
@ -8,7 +8,7 @@ import * as nls from 'vs/nls';
|
|||
import { KeyCode, KeyMod } from 'vs/base/common/keyCodes';
|
||||
import { dispose } from 'vs/base/common/lifecycle';
|
||||
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
|
||||
import { ICommonCodeEditor, IEditorContribution, EditorKbExpr } from 'vs/editor/common/editorCommon';
|
||||
import { ICommonCodeEditor, IEditorContribution, EditorContextKeys } from 'vs/editor/common/editorCommon';
|
||||
import { KbExpr } from 'vs/platform/keybinding/common/keybinding';
|
||||
import { ServicesAccessor, EditorAction, EditorCommand, CommonEditorRegistry } from 'vs/editor/common/editorCommonExtensions';
|
||||
import { ICodeEditor } from 'vs/editor/browser/editorBrowser';
|
||||
|
@ -69,7 +69,7 @@ export class TriggerParameterHintsAction extends EditorAction {
|
|||
);
|
||||
|
||||
this.kbOpts = {
|
||||
kbExpr: EditorKbExpr.TextFocus,
|
||||
kbExpr: EditorContextKeys.TextFocus,
|
||||
primary: KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.Space
|
||||
};
|
||||
}
|
||||
|
@ -91,13 +91,13 @@ const weight = CommonEditorRegistry.commandWeight(75);
|
|||
const ParameterHintsCommand = EditorCommand.bindToContribution(
|
||||
ParameterHintsController.get, {
|
||||
weight: weight,
|
||||
kbExpr: KbExpr.and(EditorKbExpr.TextFocus, Context.Visible)
|
||||
kbExpr: KbExpr.and(EditorContextKeys.TextFocus, Context.Visible)
|
||||
}
|
||||
);
|
||||
const MultipleSignaturesParameterHintsCommand = EditorCommand.bindToContribution(
|
||||
ParameterHintsController.get, {
|
||||
weight: weight,
|
||||
kbExpr: KbExpr.and(EditorKbExpr.TextFocus, Context.Visible, Context.MultipleSignatures)
|
||||
kbExpr: KbExpr.and(EditorContextKeys.TextFocus, Context.Visible, Context.MultipleSignatures)
|
||||
}
|
||||
);
|
||||
|
||||
|
|
|
@ -13,7 +13,7 @@ import {KbExpr, KbCtxKey, IKeybindingContextKey, IKeybindingService} from 'vs/pl
|
|||
import {IMarkerService} from 'vs/platform/markers/common/markers';
|
||||
import {IMessageService} from 'vs/platform/message/common/message';
|
||||
import {ITelemetryService} from 'vs/platform/telemetry/common/telemetry';
|
||||
import {ICommonCodeEditor, EditorKbExpr, IEditorContribution, IRange} from 'vs/editor/common/editorCommon';
|
||||
import {ICommonCodeEditor, EditorContextKeys, IEditorContribution, IRange} from 'vs/editor/common/editorCommon';
|
||||
import {ServicesAccessor, EditorAction, EditorCommand, CommonEditorRegistry} from 'vs/editor/common/editorCommonExtensions';
|
||||
import {ICodeEditor} from 'vs/editor/browser/editorBrowser';
|
||||
import {CodeActionProviderRegistry} from 'vs/editor/common/modes';
|
||||
|
@ -126,7 +126,7 @@ export class QuickFixAction extends EditorAction {
|
|||
);
|
||||
|
||||
this.kbOpts = {
|
||||
kbExpr: EditorKbExpr.TextFocus,
|
||||
kbExpr: EditorContextKeys.TextFocus,
|
||||
primary: KeyMod.CtrlCmd | KeyCode.US_DOT
|
||||
};
|
||||
}
|
||||
|
@ -148,7 +148,7 @@ var CONTEXT_QUICK_FIX_WIDGET_VISIBLE = new KbCtxKey<boolean>('quickFixWidgetVisi
|
|||
const QuickFixCommand = EditorCommand.bindToContribution<QuickFixController>(
|
||||
QuickFixController.getQuickFixController, {
|
||||
weight: CommonEditorRegistry.commandWeight(80),
|
||||
kbExpr: KbExpr.and(EditorKbExpr.Focus, CONTEXT_QUICK_FIX_WIDGET_VISIBLE)
|
||||
kbExpr: KbExpr.and(EditorContextKeys.Focus, CONTEXT_QUICK_FIX_WIDGET_VISIBLE)
|
||||
}
|
||||
);
|
||||
|
||||
|
|
|
@ -15,7 +15,7 @@ import {BaseEditorQuickOpenAction, IDecorator} from './editorQuickOpen';
|
|||
import {ServicesAccessor} from 'vs/editor/common/editorCommonExtensions';
|
||||
import {KeyCode, KeyMod} from 'vs/base/common/keyCodes';
|
||||
|
||||
import EditorKbExpr = editorCommon.EditorKbExpr;
|
||||
import EditorContextKeys = editorCommon.EditorContextKeys;
|
||||
|
||||
interface ParseResult {
|
||||
position: editorCommon.IPosition;
|
||||
|
@ -160,7 +160,7 @@ export class GotoLineAction extends BaseEditorQuickOpenAction {
|
|||
);
|
||||
|
||||
this.kbOpts = {
|
||||
kbExpr: EditorKbExpr.Focus,
|
||||
kbExpr: EditorContextKeys.Focus,
|
||||
primary: KeyMod.CtrlCmd | KeyCode.KEY_G,
|
||||
mac: { primary: KeyMod.WinCtrl | KeyCode.KEY_G }
|
||||
};
|
||||
|
|
|
@ -11,7 +11,7 @@ import {TPromise} from 'vs/base/common/winjs.base';
|
|||
import {IContext, IHighlight, QuickOpenEntryGroup, QuickOpenModel} from 'vs/base/parts/quickopen/browser/quickOpenModel';
|
||||
import {IAutoFocus, Mode} from 'vs/base/parts/quickopen/common/quickOpen';
|
||||
import {IKeybindingService} from 'vs/platform/keybinding/common/keybinding';
|
||||
import {IEditorAction, ICommonCodeEditor, IEditor, EditorKbExpr} from 'vs/editor/common/editorCommon';
|
||||
import {IEditorAction, ICommonCodeEditor, IEditor, EditorContextKeys} from 'vs/editor/common/editorCommon';
|
||||
import {BaseEditorQuickOpenAction} from './editorQuickOpen';
|
||||
import {ServicesAccessor} from 'vs/editor/common/editorCommonExtensions';
|
||||
import {KeyCode, KeyMod} from 'vs/base/common/keyCodes';
|
||||
|
@ -80,12 +80,12 @@ export class QuickCommandAction extends BaseEditorQuickOpenAction {
|
|||
);
|
||||
|
||||
this.kbOpts = {
|
||||
kbExpr: EditorKbExpr.Focus,
|
||||
kbExpr: EditorContextKeys.Focus,
|
||||
primary: (browser.isIE11orEarlier ? KeyMod.Alt | KeyCode.F1 : KeyCode.F1)
|
||||
};
|
||||
|
||||
this.menuOpts = {
|
||||
kbExpr: EditorKbExpr.Focus
|
||||
kbExpr: EditorContextKeys.Focus
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
@ -13,7 +13,7 @@ import * as strings from 'vs/base/common/strings';
|
|||
import {TPromise} from 'vs/base/common/winjs.base';
|
||||
import {IContext, IHighlight, QuickOpenEntryGroup, QuickOpenModel} from 'vs/base/parts/quickopen/browser/quickOpenModel';
|
||||
import {IAutoFocus, Mode} from 'vs/base/parts/quickopen/common/quickOpen';
|
||||
import {ICommonCodeEditor, IRange, ModeContextKeys, EditorKbExpr} from 'vs/editor/common/editorCommon';
|
||||
import {ICommonCodeEditor, IRange, ModeContextKeys, EditorContextKeys} from 'vs/editor/common/editorCommon';
|
||||
import {SymbolInformation, SymbolKind, DocumentSymbolProviderRegistry} from 'vs/editor/common/modes';
|
||||
import {BaseEditorQuickOpenAction, IDecorator} from './editorQuickOpen';
|
||||
import {getDocumentSymbols, IOutline} from 'vs/editor/contrib/quickOpen/common/quickOpen';
|
||||
|
@ -118,7 +118,7 @@ export class QuickOutlineAction extends BaseEditorQuickOpenAction {
|
|||
);
|
||||
|
||||
this.kbOpts = {
|
||||
kbExpr: EditorKbExpr.Focus,
|
||||
kbExpr: EditorContextKeys.Focus,
|
||||
primary: KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.KEY_O
|
||||
};
|
||||
|
||||
|
|
|
@ -25,7 +25,7 @@ import {ReferencesController, RequestOptions, ctxReferenceSearchVisible} from '.
|
|||
import {ReferencesModel} from './referencesModel';
|
||||
|
||||
import ModeContextKeys = editorCommon.ModeContextKeys;
|
||||
import EditorKbExpr = editorCommon.EditorKbExpr;
|
||||
import EditorContextKeys = editorCommon.EditorContextKeys;
|
||||
|
||||
const defaultReferenceSearchOptions: RequestOptions = {
|
||||
getMetaTitle(model) {
|
||||
|
@ -66,7 +66,7 @@ export class ReferenceAction extends EditorAction {
|
|||
);
|
||||
|
||||
this.kbOpts = {
|
||||
kbExpr: EditorKbExpr.TextFocus,
|
||||
kbExpr: EditorContextKeys.TextFocus,
|
||||
primary: KeyMod.Shift | KeyCode.F12
|
||||
};
|
||||
|
||||
|
|
|
@ -17,7 +17,7 @@ import {IMessageService} from 'vs/platform/message/common/message';
|
|||
import {IProgressService} from 'vs/platform/progress/common/progress';
|
||||
import {ServicesAccessor, EditorAction, EditorCommand, CommonEditorRegistry} from 'vs/editor/common/editorCommonExtensions';
|
||||
import {EditorBrowserRegistry} from 'vs/editor/browser/editorBrowserExtensions';
|
||||
import {IRange, ICommonCodeEditor, EditorKbExpr, ModeContextKeys, IEditorContribution} from 'vs/editor/common/editorCommon';
|
||||
import {IRange, ICommonCodeEditor, EditorContextKeys, ModeContextKeys, IEditorContribution} from 'vs/editor/common/editorCommon';
|
||||
import {BulkEdit, createBulkEdit} from 'vs/editor/common/services/bulkEdit';
|
||||
import {RenameProviderRegistry} from 'vs/editor/common/modes';
|
||||
import {ICodeEditor} from 'vs/editor/browser/editorBrowser';
|
||||
|
@ -157,14 +157,14 @@ export class RenameAction extends EditorAction {
|
|||
);
|
||||
|
||||
this.kbOpts = {
|
||||
kbExpr: EditorKbExpr.TextFocus,
|
||||
kbExpr: EditorContextKeys.TextFocus,
|
||||
primary: KeyCode.F2
|
||||
};
|
||||
|
||||
this.menuOpts = {
|
||||
group: '1_modification',
|
||||
order: 1.1,
|
||||
kbExpr: KbExpr.and(ModeContextKeys.hasRenameProvider, EditorKbExpr.Writable)
|
||||
kbExpr: KbExpr.and(ModeContextKeys.hasRenameProvider, EditorContextKeys.Writable)
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -192,7 +192,7 @@ EditorBrowserRegistry.registerEditorContribution(RenameController);
|
|||
const RenameCommand = EditorCommand.bindToContribution<RenameController>(
|
||||
RenameController.get, {
|
||||
weight: CommonEditorRegistry.commandWeight(99),
|
||||
kbExpr: KbExpr.and(EditorKbExpr.Focus, CONTEXT_RENAME_INPUT_VISIBLE)
|
||||
kbExpr: KbExpr.and(EditorContextKeys.Focus, CONTEXT_RENAME_INPUT_VISIBLE)
|
||||
}
|
||||
);
|
||||
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
|
||||
import * as nls from 'vs/nls';
|
||||
import {KeyCode, KeyMod} from 'vs/base/common/keyCodes';
|
||||
import {Handler, EditorKbExpr} from 'vs/editor/common/editorCommon';
|
||||
import {Handler, EditorContextKeys} from 'vs/editor/common/editorCommon';
|
||||
import {HandlerEditorAction, CommonEditorRegistry} from 'vs/editor/common/editorCommonExtensions';
|
||||
|
||||
class SelectBracketAction extends HandlerEditorAction {
|
||||
|
@ -23,7 +23,7 @@ class SelectBracketAction extends HandlerEditorAction {
|
|||
);
|
||||
|
||||
this.kbOpts = {
|
||||
kbExpr: EditorKbExpr.TextFocus,
|
||||
kbExpr: EditorContextKeys.TextFocus,
|
||||
primary: KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.US_BACKSLASH
|
||||
};
|
||||
}
|
||||
|
|
|
@ -10,7 +10,7 @@ import {KeyCode, KeyMod} from 'vs/base/common/keyCodes';
|
|||
import {TPromise} from 'vs/base/common/winjs.base';
|
||||
import {IInstantiationService} from 'vs/platform/instantiation/common/instantiation';
|
||||
import {Range} from 'vs/editor/common/core/range';
|
||||
import {ICommonCodeEditor, ICursorPositionChangedEvent, EditorKbExpr, IEditorContribution} from 'vs/editor/common/editorCommon';
|
||||
import {ICommonCodeEditor, ICursorPositionChangedEvent, EditorContextKeys, IEditorContribution} from 'vs/editor/common/editorCommon';
|
||||
import {ServicesAccessor, EditorAction, CommonEditorRegistry} from 'vs/editor/common/editorCommonExtensions';
|
||||
import {TokenSelectionSupport, ILogicalSelectionEntry} from './tokenSelectionSupport';
|
||||
|
||||
|
@ -166,7 +166,7 @@ class GrowSelectionAction extends AbstractSmartSelect {
|
|||
);
|
||||
|
||||
this.kbOpts = {
|
||||
kbExpr: EditorKbExpr.TextFocus,
|
||||
kbExpr: EditorContextKeys.TextFocus,
|
||||
primary: KeyMod.Shift | KeyMod.Alt | KeyCode.RightArrow,
|
||||
mac: { primary: KeyMod.CtrlCmd | KeyMod.WinCtrl | KeyMod.Shift | KeyCode.RightArrow }
|
||||
};
|
||||
|
@ -183,7 +183,7 @@ class ShrinkSelectionAction extends AbstractSmartSelect {
|
|||
);
|
||||
|
||||
this.kbOpts = {
|
||||
kbExpr: EditorKbExpr.TextFocus,
|
||||
kbExpr: EditorContextKeys.TextFocus,
|
||||
primary: KeyMod.Shift | KeyMod.Alt | KeyCode.LeftArrow,
|
||||
mac: { primary: KeyMod.CtrlCmd | KeyMod.WinCtrl | KeyMod.Shift | KeyCode.LeftArrow }
|
||||
};
|
||||
|
|
|
@ -16,7 +16,7 @@ import * as editorCommon from 'vs/editor/common/editorCommon';
|
|||
import {CommonEditorRegistry, EditorCommand} from 'vs/editor/common/editorCommonExtensions';
|
||||
import {IDisposable, dispose} from 'vs/base/common/lifecycle';
|
||||
|
||||
import EditorKbExpr = editorCommon.EditorKbExpr;
|
||||
import EditorContextKeys = editorCommon.EditorContextKeys;
|
||||
|
||||
interface IParsedLinePlaceHolderInfo {
|
||||
id: string;
|
||||
|
@ -940,7 +940,7 @@ export var CONTEXT_SNIPPET_MODE = new KbCtxKey<boolean>('inSnippetMode', false);
|
|||
const SnippetCommand = EditorCommand.bindToContribution<ISnippetController>(
|
||||
getSnippetController, {
|
||||
weight: CommonEditorRegistry.commandWeight(30),
|
||||
kbExpr: KbExpr.and(EditorKbExpr.TextFocus, CONTEXT_SNIPPET_MODE)
|
||||
kbExpr: KbExpr.and(EditorContextKeys.TextFocus, CONTEXT_SNIPPET_MODE)
|
||||
}
|
||||
);
|
||||
|
||||
|
|
|
@ -9,7 +9,7 @@ import { KeyCode, KeyMod } from 'vs/base/common/keyCodes';
|
|||
import { IDisposable, dispose } from 'vs/base/common/lifecycle';
|
||||
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
|
||||
import { KbExpr } from 'vs/platform/keybinding/common/keybinding';
|
||||
import { ICommonCodeEditor, IEditorContribution, EditorKbExpr } from 'vs/editor/common/editorCommon';
|
||||
import { ICommonCodeEditor, IEditorContribution, EditorContextKeys } from 'vs/editor/common/editorCommon';
|
||||
import { ServicesAccessor, EditorAction, EditorCommand, CommonEditorRegistry } from 'vs/editor/common/editorCommonExtensions';
|
||||
import { ISuggestSupport, SuggestRegistry } from 'vs/editor/common/modes';
|
||||
import { ICodeEditor } from 'vs/editor/browser/editorBrowser';
|
||||
|
@ -180,7 +180,7 @@ export class TriggerSuggestAction extends EditorAction {
|
|||
);
|
||||
|
||||
this.kbOpts = {
|
||||
kbExpr: EditorKbExpr.TextFocus,
|
||||
kbExpr: EditorContextKeys.TextFocus,
|
||||
primary: KeyMod.CtrlCmd | KeyCode.Space,
|
||||
mac: { primary: KeyMod.WinCtrl | KeyCode.Space }
|
||||
};
|
||||
|
@ -205,19 +205,19 @@ const weight = CommonEditorRegistry.commandWeight(90);
|
|||
const SuggestCommand = EditorCommand.bindToContribution(
|
||||
SuggestController.getController, {
|
||||
weight: weight,
|
||||
kbExpr: KbExpr.and(EditorKbExpr.TextFocus, SuggestContext.Visible)
|
||||
kbExpr: KbExpr.and(EditorContextKeys.TextFocus, SuggestContext.Visible)
|
||||
}
|
||||
);
|
||||
const MultipleSuggestionsCommand = EditorCommand.bindToContribution(
|
||||
SuggestController.getController, {
|
||||
weight: weight,
|
||||
kbExpr: KbExpr.and(EditorKbExpr.TextFocus, SuggestContext.Visible, SuggestContext.MultipleSuggestions)
|
||||
kbExpr: KbExpr.and(EditorContextKeys.TextFocus, SuggestContext.Visible, SuggestContext.MultipleSuggestions)
|
||||
}
|
||||
);
|
||||
const AcceptSuggestionsOnEnterCommand = EditorCommand.bindToContribution(
|
||||
SuggestController.getController, {
|
||||
weight: weight,
|
||||
kbExpr: KbExpr.and(EditorKbExpr.TextFocus, SuggestContext.Visible, KbExpr.has('config.editor.acceptSuggestionOnEnter'))
|
||||
kbExpr: KbExpr.and(EditorContextKeys.TextFocus, SuggestContext.Visible, KbExpr.has('config.editor.acceptSuggestionOnEnter'))
|
||||
}
|
||||
);
|
||||
|
||||
|
|
|
@ -15,7 +15,7 @@ import * as editorCommon from 'vs/editor/common/editorCommon';
|
|||
import {CommonEditorRegistry, EditorCommand} from 'vs/editor/common/editorCommonExtensions';
|
||||
import {CodeSnippet, ISnippetController, getSnippetController} from 'vs/editor/contrib/snippet/common/snippet';
|
||||
|
||||
import EditorKbExpr = editorCommon.EditorKbExpr;
|
||||
import EditorContextKeys = editorCommon.EditorContextKeys;
|
||||
|
||||
let snippetsRegistry = <ISnippetsRegistry>Registry.as(Extensions.Snippets);
|
||||
|
||||
|
@ -80,8 +80,8 @@ const TabCompletionCommand = EditorCommand.bindToContribution<TabCompletionContr
|
|||
weight: KeybindingsRegistry.WEIGHT.editorContrib(),
|
||||
kbExpr: KbExpr.and(
|
||||
TabCompletionController.ContextKey,
|
||||
EditorKbExpr.TextFocus,
|
||||
EditorKbExpr.TabDoesNotMoveFocus,
|
||||
EditorContextKeys.TextFocus,
|
||||
EditorContextKeys.TabDoesNotMoveFocus,
|
||||
KbExpr.has('config.editor.tabCompletion')
|
||||
)
|
||||
}
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
|
||||
import * as nls from 'vs/nls';
|
||||
import {KeyCode, KeyMod} from 'vs/base/common/keyCodes';
|
||||
import {ICommonCodeEditor, EditorKbExpr} from 'vs/editor/common/editorCommon';
|
||||
import {ICommonCodeEditor, EditorContextKeys} from 'vs/editor/common/editorCommon';
|
||||
import {ServicesAccessor, EditorAction, CommonEditorRegistry} from 'vs/editor/common/editorCommonExtensions';
|
||||
|
||||
class ToggleWordWrapAction extends EditorAction {
|
||||
|
@ -20,7 +20,7 @@ class ToggleWordWrapAction extends EditorAction {
|
|||
);
|
||||
|
||||
this.kbOpts = {
|
||||
kbExpr: EditorKbExpr.TextFocus,
|
||||
kbExpr: EditorContextKeys.TextFocus,
|
||||
primary: KeyMod.Alt | KeyCode.KEY_Z
|
||||
};
|
||||
}
|
||||
|
|
|
@ -12,7 +12,7 @@ import { IEditorGroupService } from 'vs/workbench/services/group/common/groupSer
|
|||
import { IWorkbenchEditorConfiguration, ActiveEditorMoveArguments, ActiveEditorMovePositioning, ActiveEditorMovePositioningBy, EditorCommands } from 'vs/workbench/common/editor';
|
||||
import { IWorkbenchEditorService } from 'vs/workbench/services/editor/common/editorService';
|
||||
import { IEditor, Position, POSITIONS } from 'vs/platform/editor/common/editor';
|
||||
import { EditorKbExpr } from 'vs/editor/common/editorCommon';
|
||||
import { EditorContextKeys } from 'vs/editor/common/editorCommon';
|
||||
|
||||
export function registerEditorComamnds() {
|
||||
_registerActiveEditorMoveCommand();
|
||||
|
@ -45,7 +45,7 @@ function _registerActiveEditorMoveCommand() {
|
|||
KeybindingsRegistry.registerCommandAndKeybindingRule({
|
||||
id: EditorCommands.MoveActiveEditor,
|
||||
weight: KeybindingsRegistry.WEIGHT.workbenchContrib(),
|
||||
when: EditorKbExpr.TextFocus,
|
||||
when: EditorContextKeys.TextFocus,
|
||||
primary: null,
|
||||
handler: (accessor, args: any) => _moveActiveEditor(args, accessor),
|
||||
description: {
|
||||
|
|
|
@ -13,7 +13,7 @@ import lifecycle = require('vs/base/common/lifecycle');
|
|||
import dom = require('vs/base/browser/dom');
|
||||
import {InputBox} from 'vs/base/browser/ui/inputbox/inputBox';
|
||||
import {CommonEditorRegistry, ServicesAccessor, EditorCommand} from 'vs/editor/common/editorCommonExtensions';
|
||||
import {EditorKbExpr, ICommonCodeEditor} from 'vs/editor/common/editorCommon';
|
||||
import {EditorContextKeys, ICommonCodeEditor} from 'vs/editor/common/editorCommon';
|
||||
import editorbrowser = require('vs/editor/browser/editorBrowser');
|
||||
import {ZoneWidget} from 'vs/editor/contrib/zoneWidget/browser/zoneWidget';
|
||||
import {IInstantiationService} from 'vs/platform/instantiation/common/instantiation';
|
||||
|
@ -127,7 +127,7 @@ class CloseBreakpointWidgetCommand extends EditorCommand {
|
|||
|
||||
this.kbOpts = {
|
||||
weight: CommonEditorRegistry.commandWeight(8),
|
||||
kbExpr: KbExpr.and(EditorKbExpr.Focus, CONTEXT_BREAKPOINT_WIDGET_VISIBLE),
|
||||
kbExpr: KbExpr.and(EditorContextKeys.Focus, CONTEXT_BREAKPOINT_WIDGET_VISIBLE),
|
||||
primary: KeyCode.Escape,
|
||||
secondary: [KeyMod.Shift | KeyCode.Escape]
|
||||
};
|
||||
|
|
|
@ -22,7 +22,7 @@ import {ServicesAccessor, EditorAction} from 'vs/editor/common/editorCommonExten
|
|||
import {KeyMod, KeyCode} from 'vs/base/common/keyCodes';
|
||||
import IDebugService = debug.IDebugService;
|
||||
|
||||
import EditorKbExpr = editorCommon.EditorKbExpr;
|
||||
import EditorContextKeys = editorCommon.EditorContextKeys;
|
||||
|
||||
export class AbstractDebugAction extends actions.Action {
|
||||
|
||||
|
@ -528,7 +528,7 @@ export class ToggleBreakpointAction extends EditorAction {
|
|||
);
|
||||
|
||||
this.kbOpts = {
|
||||
kbExpr: EditorKbExpr.TextFocus,
|
||||
kbExpr: EditorContextKeys.TextFocus,
|
||||
primary: KeyCode.F9
|
||||
};
|
||||
}
|
||||
|
@ -673,7 +673,7 @@ export class SelectionToReplAction extends EditorAction {
|
|||
);
|
||||
|
||||
this.menuOpts = {
|
||||
kbExpr: KbExpr.and(EditorKbExpr.HasNonEmptySelection, debug.CONTEXT_IN_DEBUG_MODE),
|
||||
kbExpr: KbExpr.and(EditorContextKeys.HasNonEmptySelection, debug.CONTEXT_IN_DEBUG_MODE),
|
||||
group: 'debug'
|
||||
};
|
||||
}
|
||||
|
@ -711,7 +711,7 @@ export class ShowDebugHoverAction extends EditorAction {
|
|||
);
|
||||
|
||||
this.kbOpts = {
|
||||
kbExpr: KbExpr.and(debug.CONTEXT_IN_DEBUG_MODE, EditorKbExpr.TextFocus),
|
||||
kbExpr: KbExpr.and(debug.CONTEXT_IN_DEBUG_MODE, EditorContextKeys.TextFocus),
|
||||
primary: KeyMod.chord(KeyMod.CtrlCmd | KeyCode.KEY_K, KeyMod.CtrlCmd | KeyCode.KEY_I)
|
||||
};
|
||||
}
|
||||
|
|
|
@ -9,7 +9,7 @@ import nls = require('vs/nls');
|
|||
import {BasicEmmetEditorAction} from 'vs/workbench/parts/emmet/node/emmetActions';
|
||||
|
||||
import {CommonEditorRegistry} from 'vs/editor/common/editorCommonExtensions';
|
||||
import {Handler, ICommonCodeEditor, EditorKbExpr} from 'vs/editor/common/editorCommon';
|
||||
import {Handler, ICommonCodeEditor, EditorContextKeys} from 'vs/editor/common/editorCommon';
|
||||
|
||||
import {KeyCode} from 'vs/base/common/keyCodes';
|
||||
import {KbExpr} from 'vs/platform/keybinding/common/keybinding';
|
||||
|
@ -27,10 +27,10 @@ class ExpandAbbreviationAction extends BasicEmmetEditorAction {
|
|||
this.kbOpts = {
|
||||
primary: KeyCode.Tab,
|
||||
kbExpr: KbExpr.and(
|
||||
EditorKbExpr.TextFocus,
|
||||
EditorKbExpr.HasOnlyEmptySelection,
|
||||
EditorKbExpr.HasSingleSelection,
|
||||
EditorKbExpr.TabDoesNotMoveFocus,
|
||||
EditorContextKeys.TextFocus,
|
||||
EditorContextKeys.HasOnlyEmptySelection,
|
||||
EditorContextKeys.HasSingleSelection,
|
||||
EditorContextKeys.TabDoesNotMoveFocus,
|
||||
KbExpr.has('config.emmet.triggerExpansionOnTab')
|
||||
)
|
||||
};
|
||||
|
|
|
@ -17,7 +17,7 @@ import {OutputService} from 'vs/workbench/parts/output/browser/outputServices';
|
|||
import {ToggleOutputAction} from 'vs/workbench/parts/output/browser/outputActions';
|
||||
import {OUTPUT_MIME, OUTPUT_MODE_ID, OUTPUT_PANEL_ID, IOutputService} from 'vs/workbench/parts/output/common/output';
|
||||
import panel = require('vs/workbench/browser/panel');
|
||||
import {KEYBINDING_CONTEXT_EDITOR_LANGUAGE_ID} from 'vs/editor/common/editorCommon';
|
||||
import {EditorContextKeys} from 'vs/editor/common/editorCommon';
|
||||
import {CommandsRegistry, ICommandHandler} from 'vs/platform/commands/common/commands';
|
||||
import {KbExpr} from 'vs/platform/keybinding/common/keybinding';
|
||||
|
||||
|
@ -123,7 +123,7 @@ registerAction({
|
|||
title: nls.localize('clearOutput.label', "Clear Output"),
|
||||
menu: {
|
||||
menuId: MenuId.EditorContext,
|
||||
when: KEYBINDING_CONTEXT_EDITOR_LANGUAGE_ID.isEqualTo(OUTPUT_MODE_ID)
|
||||
when: EditorContextKeys.LanguageId.isEqualTo(OUTPUT_MODE_ID)
|
||||
},
|
||||
handler(accessor) {
|
||||
accessor.get(IOutputService).getActiveChannel().clear();
|
||||
|
|
Loading…
Reference in a new issue