提交 8cb7cc0c 编写于 作者: A Alex Dima

Merge EditorContextKeys and ModeContextKeys

上级 50d1c5e5
......@@ -927,12 +927,12 @@ class EditorContextKeysManager extends Disposable {
this._editor = editor;
this._editorId = contextKeyService.createKey('editorId', editor.getId());
this._editorFocus = EditorContextKeys.Focus.bindTo(contextKeyService);
this._editorTextFocus = EditorContextKeys.TextFocus.bindTo(contextKeyService);
this._editorTabMovesFocus = EditorContextKeys.TabMovesFocus.bindTo(contextKeyService);
this._editorReadonly = EditorContextKeys.ReadOnly.bindTo(contextKeyService);
this._hasMultipleSelections = EditorContextKeys.HasMultipleSelections.bindTo(contextKeyService);
this._hasNonEmptySelection = EditorContextKeys.HasNonEmptySelection.bindTo(contextKeyService);
this._editorFocus = EditorContextKeys.focus.bindTo(contextKeyService);
this._editorTextFocus = EditorContextKeys.textFocus.bindTo(contextKeyService);
this._editorTabMovesFocus = EditorContextKeys.tabMovesFocus.bindTo(contextKeyService);
this._editorReadonly = EditorContextKeys.readOnly.bindTo(contextKeyService);
this._hasMultipleSelections = EditorContextKeys.hasMultipleSelections.bindTo(contextKeyService);
this._hasNonEmptySelection = EditorContextKeys.hasNonEmptySelection.bindTo(contextKeyService);
this._register(this._editor.onDidChangeConfiguration(() => this._updateFromConfig()));
this._register(this._editor.onDidChangeCursorSelection(() => this._updateFromSelection()));
......
......@@ -227,7 +227,7 @@ class WordCommand extends CoreCommand {
precondition: precondition,
kbOpts: {
weight: CORE_WEIGHT,
kbExpr: EditorContextKeys.TextFocus,
kbExpr: EditorContextKeys.textFocus,
primary: WordCommand.getWordNavigationKB(shift, key),
mac: { primary: WordCommand.getMacWordNavigationKB(shift, key) }
}
......@@ -282,7 +282,7 @@ registerCommand(new CoreCommand({
precondition: null,
kbOpts: {
weight: CORE_WEIGHT,
kbExpr: EditorContextKeys.TextFocus,
kbExpr: EditorContextKeys.textFocus,
primary: KeyCode.LeftArrow,
mac: { primary: KeyCode.LeftArrow, secondary: [KeyMod.WinCtrl | KeyCode.KEY_B] }
}
......@@ -292,7 +292,7 @@ registerCommand(new CoreCommand({
precondition: null,
kbOpts: {
weight: CORE_WEIGHT,
kbExpr: EditorContextKeys.TextFocus,
kbExpr: EditorContextKeys.textFocus,
primary: KeyMod.Shift | KeyCode.LeftArrow
}
}));
......@@ -301,7 +301,7 @@ registerCommand(new CoreCommand({
precondition: null,
kbOpts: {
weight: CORE_WEIGHT,
kbExpr: EditorContextKeys.TextFocus,
kbExpr: EditorContextKeys.textFocus,
primary: KeyCode.RightArrow,
mac: { primary: KeyCode.RightArrow, secondary: [KeyMod.WinCtrl | KeyCode.KEY_F] }
}
......@@ -311,7 +311,7 @@ registerCommand(new CoreCommand({
precondition: null,
kbOpts: {
weight: CORE_WEIGHT,
kbExpr: EditorContextKeys.TextFocus,
kbExpr: EditorContextKeys.textFocus,
primary: KeyMod.Shift | KeyCode.RightArrow
}
}));
......@@ -320,7 +320,7 @@ registerCommand(new CoreCommand({
precondition: null,
kbOpts: {
weight: CORE_WEIGHT,
kbExpr: EditorContextKeys.TextFocus,
kbExpr: EditorContextKeys.textFocus,
primary: KeyCode.UpArrow,
mac: { primary: KeyCode.UpArrow, secondary: [KeyMod.WinCtrl | KeyCode.KEY_P] }
}
......@@ -330,7 +330,7 @@ registerCommand(new CoreCommand({
precondition: null,
kbOpts: {
weight: CORE_WEIGHT,
kbExpr: EditorContextKeys.TextFocus,
kbExpr: EditorContextKeys.textFocus,
primary: KeyMod.Shift | KeyCode.UpArrow,
secondary: [WordCommand.getWordNavigationKB(true, KeyCode.UpArrow)],
mac: { primary: KeyMod.Shift | KeyCode.UpArrow },
......@@ -342,7 +342,7 @@ registerCommand(new CoreCommand({
precondition: null,
kbOpts: {
weight: CORE_WEIGHT,
kbExpr: EditorContextKeys.TextFocus,
kbExpr: EditorContextKeys.textFocus,
primary: KeyCode.DownArrow,
mac: { primary: KeyCode.DownArrow, secondary: [KeyMod.WinCtrl | KeyCode.KEY_N] }
}
......@@ -352,7 +352,7 @@ registerCommand(new CoreCommand({
precondition: null,
kbOpts: {
weight: CORE_WEIGHT,
kbExpr: EditorContextKeys.TextFocus,
kbExpr: EditorContextKeys.textFocus,
primary: KeyMod.Shift | KeyCode.DownArrow,
secondary: [WordCommand.getWordNavigationKB(true, KeyCode.DownArrow)],
mac: { primary: KeyMod.Shift | KeyCode.DownArrow },
......@@ -365,7 +365,7 @@ registerCommand(new CoreCommand({
precondition: null,
kbOpts: {
weight: CORE_WEIGHT,
kbExpr: EditorContextKeys.TextFocus,
kbExpr: EditorContextKeys.textFocus,
primary: KeyCode.PageUp
}
}));
......@@ -374,7 +374,7 @@ registerCommand(new CoreCommand({
precondition: null,
kbOpts: {
weight: CORE_WEIGHT,
kbExpr: EditorContextKeys.TextFocus,
kbExpr: EditorContextKeys.textFocus,
primary: KeyMod.Shift | KeyCode.PageUp
}
}));
......@@ -383,7 +383,7 @@ registerCommand(new CoreCommand({
precondition: null,
kbOpts: {
weight: CORE_WEIGHT,
kbExpr: EditorContextKeys.TextFocus,
kbExpr: EditorContextKeys.textFocus,
primary: KeyCode.PageDown
}
}));
......@@ -392,7 +392,7 @@ registerCommand(new CoreCommand({
precondition: null,
kbOpts: {
weight: CORE_WEIGHT,
kbExpr: EditorContextKeys.TextFocus,
kbExpr: EditorContextKeys.textFocus,
primary: KeyMod.Shift | KeyCode.PageDown
}
}));
......@@ -401,7 +401,7 @@ registerCommand(new CoreCommand({
precondition: null,
kbOpts: {
weight: CORE_WEIGHT,
kbExpr: EditorContextKeys.TextFocus,
kbExpr: EditorContextKeys.textFocus,
primary: KeyCode.Home,
mac: { primary: KeyCode.Home, secondary: [KeyMod.CtrlCmd | KeyCode.LeftArrow, KeyMod.WinCtrl | KeyCode.KEY_A] }
}
......@@ -411,7 +411,7 @@ registerCommand(new CoreCommand({
precondition: null,
kbOpts: {
weight: CORE_WEIGHT,
kbExpr: EditorContextKeys.TextFocus,
kbExpr: EditorContextKeys.textFocus,
primary: KeyMod.Shift | KeyCode.Home,
mac: { primary: KeyMod.Shift | KeyCode.Home, secondary: [KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.LeftArrow] }
}
......@@ -421,7 +421,7 @@ registerCommand(new CoreCommand({
precondition: null,
kbOpts: {
weight: CORE_WEIGHT,
kbExpr: EditorContextKeys.TextFocus,
kbExpr: EditorContextKeys.textFocus,
primary: KeyCode.End,
mac: { primary: KeyCode.End, secondary: [KeyMod.CtrlCmd | KeyCode.RightArrow, KeyMod.WinCtrl | KeyCode.KEY_E] }
}
......@@ -431,7 +431,7 @@ registerCommand(new CoreCommand({
precondition: null,
kbOpts: {
weight: CORE_WEIGHT,
kbExpr: EditorContextKeys.TextFocus,
kbExpr: EditorContextKeys.textFocus,
primary: KeyMod.Shift | KeyCode.End,
mac: { primary: KeyMod.Shift | KeyCode.End, secondary: [KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.RightArrow] }
}
......@@ -441,7 +441,7 @@ registerCommand(new CoreCommand({
precondition: null,
kbOpts: {
weight: CORE_WEIGHT,
kbExpr: EditorContextKeys.TextFocus,
kbExpr: EditorContextKeys.textFocus,
primary: KeyMod.CtrlCmd | KeyCode.KEY_I
}
}));
......@@ -453,7 +453,7 @@ registerCommand(new CoreCommand({
precondition: null,
kbOpts: {
weight: CORE_WEIGHT,
kbExpr: EditorContextKeys.TextFocus,
kbExpr: EditorContextKeys.textFocus,
primary: KeyMod.CtrlCmd | KeyCode.UpArrow,
mac: { primary: KeyMod.WinCtrl | KeyCode.PageUp }
}
......@@ -463,7 +463,7 @@ registerCommand(new CoreCommand({
precondition: null,
kbOpts: {
weight: CORE_WEIGHT,
kbExpr: EditorContextKeys.TextFocus,
kbExpr: EditorContextKeys.textFocus,
primary: KeyMod.CtrlCmd | KeyCode.DownArrow,
mac: { primary: KeyMod.WinCtrl | KeyCode.PageDown }
}
......@@ -474,7 +474,7 @@ registerCommand(new CoreCommand({
precondition: null,
kbOpts: {
weight: CORE_WEIGHT,
kbExpr: EditorContextKeys.TextFocus,
kbExpr: EditorContextKeys.textFocus,
primary: KeyMod.CtrlCmd | KeyCode.PageUp,
win: { primary: KeyMod.Alt | KeyCode.PageUp },
linux: { primary: KeyMod.Alt | KeyCode.PageUp }
......@@ -485,7 +485,7 @@ registerCommand(new CoreCommand({
precondition: null,
kbOpts: {
weight: CORE_WEIGHT,
kbExpr: EditorContextKeys.TextFocus,
kbExpr: EditorContextKeys.textFocus,
primary: KeyMod.CtrlCmd | KeyCode.PageDown,
win: { primary: KeyMod.Alt | KeyCode.PageDown },
linux: { primary: KeyMod.Alt | KeyCode.PageDown }
......@@ -499,7 +499,7 @@ registerCommand(new CoreCommand({
precondition: null,
kbOpts: {
weight: CORE_WEIGHT,
kbExpr: EditorContextKeys.TextFocus,
kbExpr: EditorContextKeys.textFocus,
primary: KeyMod.CtrlCmd | KeyMod.Shift | KeyMod.Alt | KeyCode.LeftArrow,
linux: { primary: 0 }
}
......@@ -509,7 +509,7 @@ registerCommand(new CoreCommand({
precondition: null,
kbOpts: {
weight: CORE_WEIGHT,
kbExpr: EditorContextKeys.TextFocus,
kbExpr: EditorContextKeys.textFocus,
primary: KeyMod.CtrlCmd | KeyMod.Shift | KeyMod.Alt | KeyCode.RightArrow,
linux: { primary: 0 }
}
......@@ -519,7 +519,7 @@ registerCommand(new CoreCommand({
precondition: null,
kbOpts: {
weight: CORE_WEIGHT,
kbExpr: EditorContextKeys.TextFocus,
kbExpr: EditorContextKeys.textFocus,
primary: KeyMod.CtrlCmd | KeyMod.Shift | KeyMod.Alt | KeyCode.UpArrow,
linux: { primary: 0 }
}
......@@ -529,7 +529,7 @@ registerCommand(new CoreCommand({
precondition: null,
kbOpts: {
weight: CORE_WEIGHT,
kbExpr: EditorContextKeys.TextFocus,
kbExpr: EditorContextKeys.textFocus,
primary: KeyMod.CtrlCmd | KeyMod.Shift | KeyMod.Alt | KeyCode.PageUp,
linux: { primary: 0 }
}
......@@ -539,7 +539,7 @@ registerCommand(new CoreCommand({
precondition: null,
kbOpts: {
weight: CORE_WEIGHT,
kbExpr: EditorContextKeys.TextFocus,
kbExpr: EditorContextKeys.textFocus,
primary: KeyMod.CtrlCmd | KeyMod.Shift | KeyMod.Alt | KeyCode.DownArrow,
linux: { primary: 0 }
}
......@@ -549,7 +549,7 @@ registerCommand(new CoreCommand({
precondition: null,
kbOpts: {
weight: CORE_WEIGHT,
kbExpr: EditorContextKeys.TextFocus,
kbExpr: EditorContextKeys.textFocus,
primary: KeyMod.CtrlCmd | KeyMod.Shift | KeyMod.Alt | KeyCode.PageDown,
linux: { primary: 0 }
}
......@@ -557,24 +557,24 @@ registerCommand(new CoreCommand({
registerCommand(new CoreCommand({
id: H.Tab,
precondition: EditorContextKeys.Writable,
precondition: EditorContextKeys.writable,
kbOpts: {
weight: CORE_WEIGHT,
kbExpr: ContextKeyExpr.and(
EditorContextKeys.TextFocus,
EditorContextKeys.TabDoesNotMoveFocus
EditorContextKeys.textFocus,
EditorContextKeys.tabDoesNotMoveFocus
),
primary: KeyCode.Tab
}
}));
registerCommand(new CoreCommand({
id: H.Outdent,
precondition: EditorContextKeys.Writable,
precondition: EditorContextKeys.writable,
kbOpts: {
weight: CORE_WEIGHT,
kbExpr: ContextKeyExpr.and(
EditorContextKeys.TextFocus,
EditorContextKeys.TabDoesNotMoveFocus
EditorContextKeys.textFocus,
EditorContextKeys.tabDoesNotMoveFocus
),
primary: KeyMod.Shift | KeyCode.Tab
}
......@@ -582,10 +582,10 @@ registerCommand(new CoreCommand({
registerCommand(new CoreCommand({
id: H.DeleteLeft,
precondition: EditorContextKeys.Writable,
precondition: EditorContextKeys.writable,
kbOpts: {
weight: CORE_WEIGHT,
kbExpr: EditorContextKeys.TextFocus,
kbExpr: EditorContextKeys.textFocus,
primary: KeyCode.Backspace,
secondary: [KeyMod.Shift | KeyCode.Backspace],
mac: { primary: KeyCode.Backspace, secondary: [KeyMod.Shift | KeyCode.Backspace, KeyMod.WinCtrl | KeyCode.KEY_H, KeyMod.WinCtrl | KeyCode.Backspace] }
......@@ -593,10 +593,10 @@ registerCommand(new CoreCommand({
}));
registerCommand(new CoreCommand({
id: H.DeleteRight,
precondition: EditorContextKeys.Writable,
precondition: EditorContextKeys.writable,
kbOpts: {
weight: CORE_WEIGHT,
kbExpr: EditorContextKeys.TextFocus,
kbExpr: EditorContextKeys.textFocus,
primary: KeyCode.Delete,
mac: { primary: KeyCode.Delete, secondary: [KeyMod.WinCtrl | KeyCode.KEY_D, KeyMod.WinCtrl | KeyCode.Delete] }
}
......@@ -604,20 +604,20 @@ registerCommand(new CoreCommand({
registerCommand(new CoreCommand({
id: H.CancelSelection,
precondition: EditorContextKeys.HasNonEmptySelection,
precondition: EditorContextKeys.hasNonEmptySelection,
kbOpts: {
weight: CORE_WEIGHT,
kbExpr: EditorContextKeys.TextFocus,
kbExpr: EditorContextKeys.textFocus,
primary: KeyCode.Escape,
secondary: [KeyMod.Shift | KeyCode.Escape]
}
}));
registerCommand(new CoreCommand({
id: H.RemoveSecondaryCursors,
precondition: EditorContextKeys.HasMultipleSelections,
precondition: EditorContextKeys.hasMultipleSelections,
kbOpts: {
weight: CORE_WEIGHT + 1,
kbExpr: EditorContextKeys.TextFocus,
kbExpr: EditorContextKeys.textFocus,
primary: KeyCode.Escape,
secondary: [KeyMod.Shift | KeyCode.Escape]
}
......@@ -628,7 +628,7 @@ registerCommand(new CoreCommand({
precondition: null,
kbOpts: {
weight: CORE_WEIGHT,
kbExpr: EditorContextKeys.TextFocus,
kbExpr: EditorContextKeys.textFocus,
primary: KeyMod.CtrlCmd | KeyCode.Home,
mac: { primary: KeyMod.CtrlCmd | KeyCode.UpArrow }
}
......@@ -638,7 +638,7 @@ registerCommand(new CoreCommand({
precondition: null,
kbOpts: {
weight: CORE_WEIGHT,
kbExpr: EditorContextKeys.TextFocus,
kbExpr: EditorContextKeys.textFocus,
primary: KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.Home,
mac: { primary: KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.UpArrow }
}
......@@ -648,7 +648,7 @@ registerCommand(new CoreCommand({
precondition: null,
kbOpts: {
weight: CORE_WEIGHT,
kbExpr: EditorContextKeys.TextFocus,
kbExpr: EditorContextKeys.textFocus,
primary: KeyMod.CtrlCmd | KeyCode.End,
mac: { primary: KeyMod.CtrlCmd | KeyCode.DownArrow }
}
......@@ -658,7 +658,7 @@ registerCommand(new CoreCommand({
precondition: null,
kbOpts: {
weight: CORE_WEIGHT,
kbExpr: EditorContextKeys.TextFocus,
kbExpr: EditorContextKeys.textFocus,
primary: KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.End,
mac: { primary: KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.DownArrow }
}
......@@ -666,10 +666,10 @@ registerCommand(new CoreCommand({
registerCommand(new CoreCommand({
id: H.LineBreakInsert,
precondition: EditorContextKeys.Writable,
precondition: EditorContextKeys.writable,
kbOpts: {
weight: CORE_WEIGHT,
kbExpr: EditorContextKeys.TextFocus,
kbExpr: EditorContextKeys.textFocus,
primary: null,
mac: { primary: KeyMod.WinCtrl | KeyCode.KEY_O }
}
......@@ -680,7 +680,7 @@ registerCommand(new CoreCommand({
precondition: null,
kbOpts: {
weight: CORE_WEIGHT,
kbExpr: EditorContextKeys.TextFocus,
kbExpr: EditorContextKeys.textFocus,
primary: KeyMod.CtrlCmd | KeyCode.KEY_U
}
}));
......@@ -747,10 +747,10 @@ class UndoCommand extends BaseTextInputAwareCommand {
constructor() {
super({
id: H.Undo,
precondition: EditorContextKeys.Writable,
precondition: EditorContextKeys.writable,
kbOpts: {
weight: CORE_WEIGHT,
kbExpr: EditorContextKeys.TextFocus,
kbExpr: EditorContextKeys.textFocus,
primary: KeyMod.CtrlCmd | KeyCode.KEY_Z
}
});
......@@ -771,10 +771,10 @@ class RedoCommand extends BaseTextInputAwareCommand {
constructor() {
super({
id: H.Redo,
precondition: EditorContextKeys.Writable,
precondition: EditorContextKeys.writable,
kbOpts: {
weight: CORE_WEIGHT,
kbExpr: EditorContextKeys.TextFocus,
kbExpr: EditorContextKeys.textFocus,
primary: KeyMod.CtrlCmd | KeyCode.KEY_Y,
secondary: [KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.KEY_Z],
mac: { primary: KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.KEY_Z }
......
......@@ -10,35 +10,24 @@ export namespace EditorContextKeys {
/**
* A context key that is set when the editor's text has focus (cursor is blinking).
*/
export const TextFocus = new RawContextKey<boolean>('editorTextFocus', false);
export const textFocus = new RawContextKey<boolean>('editorTextFocus', false);
/**
* A context key that is set when the editor's text or an editor's widget has focus.
*/
export const Focus = new RawContextKey<boolean>('editorFocus', false);
/**
* A context key that is set when the editor's text is readonly.
*/
export const ReadOnly = new RawContextKey<boolean>('editorReadonly', false);
export const Writable: ContextKeyExpr = ReadOnly.toNegated();
/**
* A context key that is set when the editor has a non-collapsed selection.
*/
export const HasNonEmptySelection = new RawContextKey<boolean>('editorHasSelection', false);
export const HasOnlyEmptySelection: ContextKeyExpr = HasNonEmptySelection.toNegated();
/**
* A context key that is set when the editor has multiple selections (multiple cursors).
*/
export const HasMultipleSelections = new RawContextKey<boolean>('editorHasMultipleSelections', false);
export const HasSingleSelection: ContextKeyExpr = HasMultipleSelections.toNegated();
export const TabMovesFocus = new RawContextKey<boolean>('editorTabMovesFocus', false);
export const TabDoesNotMoveFocus: ContextKeyExpr = TabMovesFocus.toNegated();
/**
* A context key that is set to the language associated with the model associated with the editor.
*/
export const LanguageId = new RawContextKey<string>('editorLangId', undefined);
};
export const focus = new RawContextKey<boolean>('editorFocus', false);
export const readOnly = new RawContextKey<boolean>('editorReadonly', false);
export const writable: ContextKeyExpr = readOnly.toNegated();
export const hasNonEmptySelection = new RawContextKey<boolean>('editorHasSelection', false);
export const hasOnlyEmptySelection: ContextKeyExpr = hasNonEmptySelection.toNegated();
export const hasMultipleSelections = new RawContextKey<boolean>('editorHasMultipleSelections', false);
export const hasSingleSelection: ContextKeyExpr = hasMultipleSelections.toNegated();
export const tabMovesFocus = new RawContextKey<boolean>('editorTabMovesFocus', false);
export const tabDoesNotMoveFocus: ContextKeyExpr = tabMovesFocus.toNegated();
export const isInEmbeddedEditor = new RawContextKey<boolean>('isInEmbeddedEditor', undefined);
export namespace ModeContextKeys {
// -- mode context keys
export const languageId = new RawContextKey<string>('editorLangId', undefined);
export const hasCompletionItemProvider = new RawContextKey<boolean>('editorHasCompletionItemProvider', undefined);
export const hasCodeActionsProvider = new RawContextKey<boolean>('editorHasCodeActionsProvider', undefined);
export const hasCodeLensProvider = new RawContextKey<boolean>('editorHasCodeLensProvider', undefined);
......@@ -53,5 +42,4 @@ export namespace ModeContextKeys {
export const hasDocumentFormattingProvider = new RawContextKey<boolean>('editorHasDocumentFormattingProvider', undefined);
export const hasDocumentSelectionFormattingProvider = new RawContextKey<boolean>('editorHasDocumentSelectionFormattingProvider', undefined);
export const hasSignatureHelpProvider = new RawContextKey<boolean>('editorHasSignatureHelpProvider', undefined);
export const isInEmbeddedEditor = new RawContextKey<boolean>('isInEmbeddedEditor', undefined);
}
};
......@@ -8,7 +8,7 @@ import { Disposable } from 'vs/base/common/lifecycle';
import { IContextKey, IContextKeyService } from 'vs/platform/contextkey/common/contextkey';
import * as modes from 'vs/editor/common/modes';
import { ICommonCodeEditor } from 'vs/editor/common/editorCommon';
import { EditorContextKeys, ModeContextKeys } from 'vs/editor/common/editorContextKeys';
import { EditorContextKeys } from 'vs/editor/common/editorContextKeys';
import { Schemas } from 'vs/base/common/network';
export class EditorModeContext extends Disposable {
......@@ -39,22 +39,22 @@ export class EditorModeContext extends Disposable {
super();
this._editor = editor;
this._langId = EditorContextKeys.LanguageId.bindTo(contextKeyService);
this._hasCompletionItemProvider = ModeContextKeys.hasCompletionItemProvider.bindTo(contextKeyService);
this._hasCodeActionsProvider = ModeContextKeys.hasCodeActionsProvider.bindTo(contextKeyService);
this._hasCodeLensProvider = ModeContextKeys.hasCodeLensProvider.bindTo(contextKeyService);
this._hasDefinitionProvider = ModeContextKeys.hasDefinitionProvider.bindTo(contextKeyService);
this._hasImplementationProvider = ModeContextKeys.hasImplementationProvider.bindTo(contextKeyService);
this._hasTypeDefinitionProvider = ModeContextKeys.hasTypeDefinitionProvider.bindTo(contextKeyService);
this._hasHoverProvider = ModeContextKeys.hasHoverProvider.bindTo(contextKeyService);
this._hasDocumentHighlightProvider = ModeContextKeys.hasDocumentHighlightProvider.bindTo(contextKeyService);
this._hasDocumentSymbolProvider = ModeContextKeys.hasDocumentSymbolProvider.bindTo(contextKeyService);
this._hasReferenceProvider = ModeContextKeys.hasReferenceProvider.bindTo(contextKeyService);
this._hasRenameProvider = ModeContextKeys.hasRenameProvider.bindTo(contextKeyService);
this._hasDocumentFormattingProvider = ModeContextKeys.hasDocumentFormattingProvider.bindTo(contextKeyService);
this._hasDocumentSelectionFormattingProvider = ModeContextKeys.hasDocumentSelectionFormattingProvider.bindTo(contextKeyService);
this._hasSignatureHelpProvider = ModeContextKeys.hasSignatureHelpProvider.bindTo(contextKeyService);
this._isInWalkThrough = ModeContextKeys.isInEmbeddedEditor.bindTo(contextKeyService);
this._langId = EditorContextKeys.languageId.bindTo(contextKeyService);
this._hasCompletionItemProvider = EditorContextKeys.hasCompletionItemProvider.bindTo(contextKeyService);
this._hasCodeActionsProvider = EditorContextKeys.hasCodeActionsProvider.bindTo(contextKeyService);
this._hasCodeLensProvider = EditorContextKeys.hasCodeLensProvider.bindTo(contextKeyService);
this._hasDefinitionProvider = EditorContextKeys.hasDefinitionProvider.bindTo(contextKeyService);
this._hasImplementationProvider = EditorContextKeys.hasImplementationProvider.bindTo(contextKeyService);
this._hasTypeDefinitionProvider = EditorContextKeys.hasTypeDefinitionProvider.bindTo(contextKeyService);
this._hasHoverProvider = EditorContextKeys.hasHoverProvider.bindTo(contextKeyService);
this._hasDocumentHighlightProvider = EditorContextKeys.hasDocumentHighlightProvider.bindTo(contextKeyService);
this._hasDocumentSymbolProvider = EditorContextKeys.hasDocumentSymbolProvider.bindTo(contextKeyService);
this._hasReferenceProvider = EditorContextKeys.hasReferenceProvider.bindTo(contextKeyService);
this._hasRenameProvider = EditorContextKeys.hasRenameProvider.bindTo(contextKeyService);
this._hasDocumentFormattingProvider = EditorContextKeys.hasDocumentFormattingProvider.bindTo(contextKeyService);
this._hasDocumentSelectionFormattingProvider = EditorContextKeys.hasDocumentSelectionFormattingProvider.bindTo(contextKeyService);
this._hasSignatureHelpProvider = EditorContextKeys.hasSignatureHelpProvider.bindTo(contextKeyService);
this._isInWalkThrough = EditorContextKeys.isInEmbeddedEditor.bindTo(contextKeyService);
const update = () => this._update();
......
......@@ -207,7 +207,7 @@ class ShowAccessibilityHelpAction extends EditorAction {
alias: 'Show Accessibility Help',
precondition: null,
kbOpts: {
kbExpr: EditorContextKeys.Focus,
kbExpr: EditorContextKeys.focus,
primary: KeyMod.Alt | KeyCode.F1
}
});
......@@ -229,7 +229,7 @@ CommonEditorRegistry.registerEditorCommand(new AccessibilityHelpCommand({
handler: x => x.hide(),
kbOpts: {
weight: CommonEditorRegistry.commandWeight(100),
kbExpr: EditorContextKeys.Focus,
kbExpr: EditorContextKeys.focus,
primary: KeyCode.Escape, secondary: [KeyMod.Shift | KeyCode.Escape]
}
}));
......
......@@ -25,7 +25,7 @@ class SelectBracketAction extends EditorAction {
alias: 'Go to Bracket',
precondition: null,
kbOpts: {
kbExpr: EditorContextKeys.TextFocus,
kbExpr: EditorContextKeys.textFocus,
primary: KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.US_BACKSLASH
}
});
......
......@@ -40,7 +40,7 @@ class MoveCaretLeftAction extends MoveCaretAction {
id: 'editor.action.moveCarretLeftAction',
label: nls.localize('caret.moveLeft', "Move Caret Left"),
alias: 'Move Caret Left',
precondition: EditorContextKeys.Writable
precondition: EditorContextKeys.writable
});
}
}
......@@ -52,7 +52,7 @@ class MoveCaretRightAction extends MoveCaretAction {
id: 'editor.action.moveCarretRightAction',
label: nls.localize('caret.moveRight', "Move Caret Right"),
alias: 'Move Caret Right',
precondition: EditorContextKeys.Writable
precondition: EditorContextKeys.writable
});
}
}
......@@ -20,9 +20,9 @@ class TransposeLettersAction extends EditorAction {
id: 'editor.action.transposeLetters',
label: nls.localize('transposeLetters.label', "Transpose Letters"),
alias: 'Transpose Letters',
precondition: EditorContextKeys.Writable,
precondition: EditorContextKeys.writable,
kbOpts: {
kbExpr: EditorContextKeys.TextFocus,
kbExpr: EditorContextKeys.textFocus,
primary: 0,
mac: {
primary: KeyMod.WinCtrl | KeyCode.KEY_T
......
......@@ -67,9 +67,9 @@ class ExecCommandCutAction extends ExecCommandAction {
id: 'editor.action.clipboardCutAction',
label: nls.localize('actions.clipboard.cutLabel', "Cut"),
alias: 'Cut',
precondition: EditorContextKeys.Writable,
precondition: EditorContextKeys.writable,
kbOpts: {
kbExpr: EditorContextKeys.TextFocus,
kbExpr: EditorContextKeys.textFocus,
primary: KeyMod.CtrlCmd | KeyCode.KEY_X,
win: { primary: KeyMod.CtrlCmd | KeyCode.KEY_X, secondary: [KeyMod.Shift | KeyCode.Delete] }
},
......@@ -101,7 +101,7 @@ class ExecCommandCopyAction extends ExecCommandAction {
alias: 'Copy',
precondition: null,
kbOpts: {
kbExpr: EditorContextKeys.TextFocus,
kbExpr: EditorContextKeys.textFocus,
primary: KeyMod.CtrlCmd | KeyCode.KEY_C,
win: { primary: KeyMod.CtrlCmd | KeyCode.KEY_C, secondary: [KeyMod.CtrlCmd | KeyCode.Insert] }
},
......@@ -131,9 +131,9 @@ class ExecCommandPasteAction extends ExecCommandAction {
id: 'editor.action.clipboardPasteAction',
label: nls.localize('actions.clipboard.pasteLabel', "Paste"),
alias: 'Paste',
precondition: EditorContextKeys.Writable,
precondition: EditorContextKeys.writable,
kbOpts: {
kbExpr: EditorContextKeys.TextFocus,
kbExpr: EditorContextKeys.textFocus,
primary: KeyMod.CtrlCmd | KeyCode.KEY_V,
win: { primary: KeyMod.CtrlCmd | KeyCode.KEY_V, secondary: [KeyMod.Shift | KeyCode.Insert] }
},
......@@ -155,7 +155,7 @@ class ExecCommandCopyWithSyntaxHighlightingAction extends ExecCommandAction {
alias: 'Copy With Syntax Highlighting',
precondition: null,
kbOpts: {
kbExpr: EditorContextKeys.TextFocus,
kbExpr: EditorContextKeys.textFocus,
primary: null
}
});
......
......@@ -47,9 +47,9 @@ class ToggleCommentLineAction extends CommentLineAction {
id: 'editor.action.commentLine',
label: nls.localize('comment.line', "Toggle Line Comment"),
alias: 'Toggle Line Comment',
precondition: EditorContextKeys.Writable,
precondition: EditorContextKeys.writable,
kbOpts: {
kbExpr: EditorContextKeys.TextFocus,
kbExpr: EditorContextKeys.textFocus,
primary: KeyMod.CtrlCmd | KeyCode.US_SLASH
}
});
......@@ -63,9 +63,9 @@ class AddLineCommentAction extends CommentLineAction {
id: 'editor.action.addCommentLine',
label: nls.localize('comment.line.add', "Add Line Comment"),
alias: 'Add Line Comment',
precondition: EditorContextKeys.Writable,
precondition: EditorContextKeys.writable,
kbOpts: {
kbExpr: EditorContextKeys.TextFocus,
kbExpr: EditorContextKeys.textFocus,
primary: KeyChord(KeyMod.CtrlCmd | KeyCode.KEY_K, KeyMod.CtrlCmd | KeyCode.KEY_C)
}
});
......@@ -79,9 +79,9 @@ class RemoveLineCommentAction extends CommentLineAction {
id: 'editor.action.removeCommentLine',
label: nls.localize('comment.line.remove', "Remove Line Comment"),
alias: 'Remove Line Comment',
precondition: EditorContextKeys.Writable,
precondition: EditorContextKeys.writable,
kbOpts: {
kbExpr: EditorContextKeys.TextFocus,
kbExpr: EditorContextKeys.textFocus,
primary: KeyChord(KeyMod.CtrlCmd | KeyCode.KEY_K, KeyMod.CtrlCmd | KeyCode.KEY_U)
}
});
......@@ -96,9 +96,9 @@ class BlockCommentAction extends EditorAction {
id: 'editor.action.blockComment',
label: nls.localize('comment.block', "Toggle Block Comment"),
alias: 'Toggle Block Comment',
precondition: EditorContextKeys.Writable,
precondition: EditorContextKeys.writable,
kbOpts: {
kbExpr: EditorContextKeys.TextFocus,
kbExpr: EditorContextKeys.textFocus,
primary: KeyMod.Shift | KeyMod.Alt | KeyCode.KEY_A,
linux: { primary: KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.KEY_A }
}
......
......@@ -227,7 +227,7 @@ class ShowContextMenu extends EditorAction {
alias: 'Show Editor Context Menu',
precondition: null,
kbOpts: {
kbExpr: EditorContextKeys.TextFocus,
kbExpr: EditorContextKeys.textFocus,
primary: KeyMod.Shift | KeyCode.F10
}
});
......
......@@ -339,7 +339,7 @@ export class NextMatchFindAction extends MatchFindAction {
alias: 'Find Next',
precondition: null,
kbOpts: {
kbExpr: EditorContextKeys.Focus,
kbExpr: EditorContextKeys.focus,
primary: KeyCode.F3,
mac: { primary: KeyMod.CtrlCmd | KeyCode.KEY_G, secondary: [KeyCode.F3] }
}
......@@ -361,7 +361,7 @@ export class PreviousMatchFindAction extends MatchFindAction {
alias: 'Find Previous',
precondition: null,
kbOpts: {
kbExpr: EditorContextKeys.Focus,
kbExpr: EditorContextKeys.focus,
primary: KeyMod.Shift | KeyCode.F3,
mac: { primary: KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.KEY_G, secondary: [KeyMod.Shift | KeyCode.F3] }
}
......@@ -407,7 +407,7 @@ export class NextSelectionMatchFindAction extends SelectionMatchFindAction {
alias: 'Find Next Selection',
precondition: null,
kbOpts: {
kbExpr: EditorContextKeys.Focus,
kbExpr: EditorContextKeys.focus,
primary: KeyMod.CtrlCmd | KeyCode.F3
}
});
......@@ -428,7 +428,7 @@ export class PreviousSelectionMatchFindAction extends SelectionMatchFindAction {
alias: 'Find Previous Selection',
precondition: null,
kbOpts: {
kbExpr: EditorContextKeys.Focus,
kbExpr: EditorContextKeys.focus,
primary: KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.F3
}
});
......@@ -608,7 +608,7 @@ export class AddSelectionToNextFindMatchAction extends SelectNextFindMatchAction
alias: 'Add Selection To Next Find Match',
precondition: null,
kbOpts: {
kbExpr: EditorContextKeys.Focus,
kbExpr: EditorContextKeys.focus,
primary: KeyMod.CtrlCmd | KeyCode.KEY_D
}
});
......@@ -714,7 +714,7 @@ export class MoveSelectionToNextFindMatchAction extends SelectNextFindMatchActio
alias: 'Move Last Selection To Next Find Match',
precondition: null,
kbOpts: {
kbExpr: EditorContextKeys.Focus,
kbExpr: EditorContextKeys.focus,
primary: KeyChord(KeyMod.CtrlCmd | KeyCode.KEY_K, KeyMod.CtrlCmd | KeyCode.KEY_D)
}
});
......@@ -797,7 +797,7 @@ export class SelectHighlightsAction extends AbstractSelectHighlightsAction {
alias: 'Select All Occurrences of Find Match',
precondition: null,
kbOpts: {
kbExpr: EditorContextKeys.Focus,
kbExpr: EditorContextKeys.focus,
primary: KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.KEY_L
}
});
......@@ -811,9 +811,9 @@ export class CompatChangeAll extends AbstractSelectHighlightsAction {
id: 'editor.action.changeAll',
label: nls.localize('changeAll.label', "Change All Occurrences"),
alias: 'Change All Occurrences',
precondition: EditorContextKeys.Writable,
precondition: EditorContextKeys.writable,
kbOpts: {
kbExpr: EditorContextKeys.TextFocus,
kbExpr: EditorContextKeys.textFocus,
primary: KeyMod.CtrlCmd | KeyCode.F2
},
menuOpts: {
......@@ -1016,7 +1016,7 @@ CommonEditorRegistry.registerEditorCommand(new FindCommand({
handler: x => x.closeFindWidget(),
kbOpts: {
weight: CommonEditorRegistry.commandWeight(5),
kbExpr: EditorContextKeys.Focus,
kbExpr: EditorContextKeys.focus,
primary: KeyCode.Escape,
secondary: [KeyMod.Shift | KeyCode.Escape]
}
......@@ -1028,7 +1028,7 @@ CommonEditorRegistry.registerEditorCommand(new FindCommand({
handler: x => x.toggleCaseSensitive(),
kbOpts: {
weight: CommonEditorRegistry.commandWeight(5),
kbExpr: EditorContextKeys.Focus,
kbExpr: EditorContextKeys.focus,
primary: ToggleCaseSensitiveKeybinding.primary,
mac: ToggleCaseSensitiveKeybinding.mac,
win: ToggleCaseSensitiveKeybinding.win,
......@@ -1042,7 +1042,7 @@ CommonEditorRegistry.registerEditorCommand(new FindCommand({
handler: x => x.toggleWholeWords(),
kbOpts: {
weight: CommonEditorRegistry.commandWeight(5),
kbExpr: EditorContextKeys.Focus,
kbExpr: EditorContextKeys.focus,
primary: ToggleWholeWordKeybinding.primary,
mac: ToggleWholeWordKeybinding.mac,
win: ToggleWholeWordKeybinding.win,
......@@ -1056,7 +1056,7 @@ CommonEditorRegistry.registerEditorCommand(new FindCommand({
handler: x => x.toggleRegex(),
kbOpts: {
weight: CommonEditorRegistry.commandWeight(5),
kbExpr: EditorContextKeys.Focus,
kbExpr: EditorContextKeys.focus,
primary: ToggleRegexKeybinding.primary,
mac: ToggleRegexKeybinding.mac,
win: ToggleRegexKeybinding.win,
......@@ -1070,7 +1070,7 @@ CommonEditorRegistry.registerEditorCommand(new FindCommand({
handler: x => x.replace(),
kbOpts: {
weight: CommonEditorRegistry.commandWeight(5),
kbExpr: EditorContextKeys.Focus,
kbExpr: EditorContextKeys.focus,
primary: KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.KEY_1
}
}));
......@@ -1081,7 +1081,7 @@ CommonEditorRegistry.registerEditorCommand(new FindCommand({
handler: x => x.replaceAll(),
kbOpts: {
weight: CommonEditorRegistry.commandWeight(5),
kbExpr: EditorContextKeys.Focus,
kbExpr: EditorContextKeys.focus,
primary: KeyMod.CtrlCmd | KeyMod.Alt | KeyCode.Enter
}
}));
......@@ -1092,7 +1092,7 @@ CommonEditorRegistry.registerEditorCommand(new FindCommand({
handler: x => x.selectAllMatches(),
kbOpts: {
weight: CommonEditorRegistry.commandWeight(5),
kbExpr: EditorContextKeys.Focus,
kbExpr: EditorContextKeys.focus,
primary: KeyMod.Alt | KeyCode.Enter
}
}));
......@@ -1103,7 +1103,7 @@ CommonEditorRegistry.registerEditorCommand(new FindCommand({
handler: x => x.showPreviousFindTerm(),
kbOpts: {
weight: CommonEditorRegistry.commandWeight(5),
kbExpr: ContextKeyExpr.and(CONTEXT_FIND_INPUT_FOCUSSED, EditorContextKeys.Focus),
kbExpr: ContextKeyExpr.and(CONTEXT_FIND_INPUT_FOCUSSED, EditorContextKeys.focus),
primary: ShowPreviousFindTermKeybinding.primary,
mac: ShowPreviousFindTermKeybinding.mac,
win: ShowPreviousFindTermKeybinding.win,
......@@ -1117,7 +1117,7 @@ CommonEditorRegistry.registerEditorCommand(new FindCommand({
handler: x => x.showNextFindTerm(),
kbOpts: {
weight: CommonEditorRegistry.commandWeight(5),
kbExpr: ContextKeyExpr.and(CONTEXT_FIND_INPUT_FOCUSSED, EditorContextKeys.Focus),
kbExpr: ContextKeyExpr.and(CONTEXT_FIND_INPUT_FOCUSSED, EditorContextKeys.focus),
primary: ShowNextFindTermKeybinding.primary,
mac: ShowNextFindTermKeybinding.mac,
win: ShowNextFindTermKeybinding.win,
......
......@@ -541,7 +541,7 @@ class UnfoldAction extends FoldingAction<FoldingArguments> {
alias: 'Unfold',
precondition: null,
kbOpts: {
kbExpr: EditorContextKeys.TextFocus,
kbExpr: EditorContextKeys.textFocus,
primary: KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.US_CLOSE_SQUARE_BRACKET,
mac: {
primary: KeyMod.CtrlCmd | KeyMod.Alt | KeyCode.US_CLOSE_SQUARE_BRACKET
......@@ -577,7 +577,7 @@ class UnFoldRecursivelyAction extends FoldingAction<void> {
alias: 'Unfold Recursively',
precondition: null,
kbOpts: {
kbExpr: EditorContextKeys.TextFocus,
kbExpr: EditorContextKeys.textFocus,
primary: KeyChord(KeyMod.CtrlCmd | KeyCode.KEY_K, KeyMod.CtrlCmd | KeyCode.US_CLOSE_SQUARE_BRACKET)
}
});
......@@ -598,7 +598,7 @@ class FoldAction extends FoldingAction<FoldingArguments> {
alias: 'Fold',
precondition: null,
kbOpts: {
kbExpr: EditorContextKeys.TextFocus,
kbExpr: EditorContextKeys.textFocus,
primary: KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.US_OPEN_SQUARE_BRACKET,
mac: {
primary: KeyMod.CtrlCmd | KeyMod.Alt | KeyCode.US_OPEN_SQUARE_BRACKET
......@@ -636,7 +636,7 @@ class FoldRecursivelyAction extends FoldingAction<void> {
alias: 'Fold Recursively',
precondition: null,
kbOpts: {
kbExpr: EditorContextKeys.TextFocus,
kbExpr: EditorContextKeys.textFocus,
primary: KeyChord(KeyMod.CtrlCmd | KeyCode.KEY_K, KeyMod.CtrlCmd | KeyCode.US_OPEN_SQUARE_BRACKET)
}
});
......@@ -657,7 +657,7 @@ class FoldAllAction extends FoldingAction<void> {
alias: 'Fold All',
precondition: null,
kbOpts: {
kbExpr: EditorContextKeys.TextFocus,
kbExpr: EditorContextKeys.textFocus,
primary: KeyChord(KeyMod.CtrlCmd | KeyCode.KEY_K, KeyMod.CtrlCmd | KeyCode.KEY_0)
}
});
......@@ -678,7 +678,7 @@ class UnfoldAllAction extends FoldingAction<void> {
alias: 'Unfold All',
precondition: null,
kbOpts: {
kbExpr: EditorContextKeys.TextFocus,
kbExpr: EditorContextKeys.textFocus,
primary: KeyChord(KeyMod.CtrlCmd | KeyCode.KEY_K, KeyMod.CtrlCmd | KeyCode.KEY_J)
}
});
......@@ -714,7 +714,7 @@ for (let i = 1; i <= 9; i++) {
alias: `Fold Level ${i}`,
precondition: null,
kbOpts: {
kbExpr: EditorContextKeys.TextFocus,
kbExpr: EditorContextKeys.textFocus,
primary: KeyChord(KeyMod.CtrlCmd | KeyCode.KEY_K, KeyMod.CtrlCmd | (KeyCode.KEY_0 + i))
}
})
......
......@@ -22,7 +22,7 @@ import { CharacterSet } from 'vs/editor/common/core/characterClassifier';
import { Range } from 'vs/editor/common/core/range';
import { alert } from 'vs/base/browser/ui/aria/aria';
import { EditorState, CodeEditorStateFlag } from "vs/editor/common/core/editorState";
import { EditorContextKeys, ModeContextKeys } from 'vs/editor/common/editorContextKeys';
import { EditorContextKeys } from 'vs/editor/common/editorContextKeys';
function alertFormattingEdits(edits: editorCommon.ISingleEditOperation[]): void {
......@@ -296,9 +296,9 @@ export class FormatDocumentAction extends AbstractFormatAction {
id: 'editor.action.formatDocument',
label: nls.localize('formatDocument.label', "Format Document"),
alias: 'Format Document',
precondition: ContextKeyExpr.and(EditorContextKeys.Writable, ModeContextKeys.hasDocumentFormattingProvider),
precondition: ContextKeyExpr.and(EditorContextKeys.writable, EditorContextKeys.hasDocumentFormattingProvider),
kbOpts: {
kbExpr: EditorContextKeys.TextFocus,
kbExpr: EditorContextKeys.textFocus,
primary: KeyMod.Shift | KeyMod.Alt | KeyCode.KEY_F,
// secondary: [KeyChord(KeyMod.CtrlCmd | KeyCode.KEY_K, KeyMod.CtrlCmd | KeyCode.KEY_D)],
linux: { primary: KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.KEY_I }
......@@ -325,9 +325,9 @@ export class FormatSelectionAction extends AbstractFormatAction {
id: 'editor.action.formatSelection',
label: nls.localize('formatSelection.label', "Format Selection"),
alias: 'Format Code',
precondition: ContextKeyExpr.and(EditorContextKeys.Writable, ModeContextKeys.hasDocumentSelectionFormattingProvider, EditorContextKeys.HasNonEmptySelection),
precondition: ContextKeyExpr.and(EditorContextKeys.writable, EditorContextKeys.hasDocumentSelectionFormattingProvider, EditorContextKeys.hasNonEmptySelection),
kbOpts: {
kbExpr: EditorContextKeys.TextFocus,
kbExpr: EditorContextKeys.textFocus,
primary: KeyChord(KeyMod.CtrlCmd | KeyCode.KEY_K, KeyMod.CtrlCmd | KeyCode.KEY_F)
},
menuOpts: {
......
......@@ -35,7 +35,7 @@ import { ContextKeyExpr } from 'vs/platform/contextkey/common/contextkey';
import { ITextModelResolverService } from 'vs/editor/common/services/resolverService';
import { MessageController } from './messageController';
import * as corePosition from 'vs/editor/common/core/position';
import { EditorContextKeys, ModeContextKeys } from 'vs/editor/common/editorContextKeys';
import { EditorContextKeys } from 'vs/editor/common/editorContextKeys';
import { ICursorSelectionChangedEvent } from "vs/editor/common/controller/cursorEvents";
import { registerThemingParticipant } from 'vs/platform/theme/common/themeService';
import { editorActiveLinkForeground } from 'vs/platform/theme/common/colorRegistry';
......@@ -181,10 +181,10 @@ export class GoToDefinitionAction extends DefinitionAction {
label: nls.localize('actions.goToDecl.label', "Go to Definition"),
alias: 'Go to Definition',
precondition: ContextKeyExpr.and(
ModeContextKeys.hasDefinitionProvider,
ModeContextKeys.isInEmbeddedEditor.toNegated()),
EditorContextKeys.hasDefinitionProvider,
EditorContextKeys.isInEmbeddedEditor.toNegated()),
kbOpts: {
kbExpr: EditorContextKeys.TextFocus,
kbExpr: EditorContextKeys.textFocus,
primary: goToDeclarationKb
},
menuOpts: {
......@@ -206,10 +206,10 @@ export class OpenDefinitionToSideAction extends DefinitionAction {
label: nls.localize('actions.goToDeclToSide.label', "Open Definition to the Side"),
alias: 'Open Definition to the Side',
precondition: ContextKeyExpr.and(
ModeContextKeys.hasDefinitionProvider,
ModeContextKeys.isInEmbeddedEditor.toNegated()),
EditorContextKeys.hasDefinitionProvider,
EditorContextKeys.isInEmbeddedEditor.toNegated()),
kbOpts: {
kbExpr: EditorContextKeys.TextFocus,
kbExpr: EditorContextKeys.textFocus,
primary: KeyChord(KeyMod.CtrlCmd | KeyCode.KEY_K, goToDeclarationKb)
}
});
......@@ -224,11 +224,11 @@ export class PeekDefinitionAction extends DefinitionAction {
label: nls.localize('actions.previewDecl.label', "Peek Definition"),
alias: 'Peek Definition',
precondition: ContextKeyExpr.and(
ModeContextKeys.hasDefinitionProvider,
EditorContextKeys.hasDefinitionProvider,
PeekContext.notInPeekEditor,
ModeContextKeys.isInEmbeddedEditor.toNegated()),
EditorContextKeys.isInEmbeddedEditor.toNegated()),
kbOpts: {
kbExpr: EditorContextKeys.TextFocus,
kbExpr: EditorContextKeys.textFocus,
primary: KeyMod.Alt | KeyCode.F12,
linux: { primary: KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.F10 }
},
......@@ -267,10 +267,10 @@ export class GoToImplementationAction extends ImplementationAction {
label: nls.localize('actions.goToImplementation.label', "Go to Implementation"),
alias: 'Go to Implementation',
precondition: ContextKeyExpr.and(
ModeContextKeys.hasImplementationProvider,
ModeContextKeys.isInEmbeddedEditor.toNegated()),
EditorContextKeys.hasImplementationProvider,
EditorContextKeys.isInEmbeddedEditor.toNegated()),
kbOpts: {
kbExpr: EditorContextKeys.TextFocus,
kbExpr: EditorContextKeys.textFocus,
primary: KeyMod.CtrlCmd | KeyCode.F12
},
menuOpts: {
......@@ -292,10 +292,10 @@ export class PeekImplementationAction extends ImplementationAction {
label: nls.localize('actions.peekImplementation.label', "Peek Implementation"),
alias: 'Peek Implementation',
precondition: ContextKeyExpr.and(
ModeContextKeys.hasImplementationProvider,
ModeContextKeys.isInEmbeddedEditor.toNegated()),
EditorContextKeys.hasImplementationProvider,
EditorContextKeys.isInEmbeddedEditor.toNegated()),
kbOpts: {
kbExpr: EditorContextKeys.TextFocus,
kbExpr: EditorContextKeys.textFocus,
primary: KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.F12
}
});
......@@ -329,10 +329,10 @@ export class GoToTypeDefintionAction extends TypeDefinitionAction {
label: nls.localize('actions.goToTypeDefinition.label', "Go to Type Definition"),
alias: 'Go to Type Definition',
precondition: ContextKeyExpr.and(
ModeContextKeys.hasTypeDefinitionProvider,
ModeContextKeys.isInEmbeddedEditor.toNegated()),
EditorContextKeys.hasTypeDefinitionProvider,
EditorContextKeys.isInEmbeddedEditor.toNegated()),
kbOpts: {
kbExpr: EditorContextKeys.TextFocus,
kbExpr: EditorContextKeys.textFocus,
primary: 0
},
menuOpts: {
......@@ -354,10 +354,10 @@ export class PeekTypeDefinitionAction extends TypeDefinitionAction {
label: nls.localize('actions.peekTypeDefinition.label', "Peek Type Definition"),
alias: 'Peek Type Definition',
precondition: ContextKeyExpr.and(
ModeContextKeys.hasTypeDefinitionProvider,
ModeContextKeys.isInEmbeddedEditor.toNegated()),
EditorContextKeys.hasTypeDefinitionProvider,
EditorContextKeys.isInEmbeddedEditor.toNegated()),
kbOpts: {
kbExpr: EditorContextKeys.TextFocus,
kbExpr: EditorContextKeys.textFocus,
primary: 0
}
});
......
......@@ -434,9 +434,9 @@ class NextMarkerAction extends MarkerNavigationAction {
id: 'editor.action.marker.next',
label: nls.localize('markerAction.next.label', "Go to Next Error or Warning"),
alias: 'Go to Next Error or Warning',
precondition: EditorContextKeys.Writable,
precondition: EditorContextKeys.writable,
kbOpts: {
kbExpr: EditorContextKeys.Focus,
kbExpr: EditorContextKeys.focus,
primary: KeyCode.F8
}
});
......@@ -450,9 +450,9 @@ class PrevMarkerAction extends MarkerNavigationAction {
id: 'editor.action.marker.prev',
label: nls.localize('markerAction.previous.label', "Go to Previous Error or Warning"),
alias: 'Go to Previous Error or Warning',
precondition: EditorContextKeys.Writable,
precondition: EditorContextKeys.writable,
kbOpts: {
kbExpr: EditorContextKeys.Focus,
kbExpr: EditorContextKeys.focus,
primary: KeyMod.Shift | KeyCode.F8
}
});
......@@ -469,7 +469,7 @@ CommonEditorRegistry.registerEditorCommand(new MarkerCommand({
handler: x => x.closeMarkersNavigation(),
kbOpts: {
weight: CommonEditorRegistry.commandWeight(50),
kbExpr: EditorContextKeys.Focus,
kbExpr: EditorContextKeys.focus,
primary: KeyCode.Escape,
secondary: [KeyMod.Shift | KeyCode.Escape]
}
......
......@@ -155,7 +155,7 @@ class ShowHoverAction extends EditorAction {
alias: 'Show Hover',
precondition: null,
kbOpts: {
kbExpr: EditorContextKeys.TextFocus,
kbExpr: EditorContextKeys.textFocus,
primary: KeyChord(KeyMod.CtrlCmd | KeyCode.KEY_K, KeyMod.CtrlCmd | KeyCode.KEY_I)
}
});
......
......@@ -138,9 +138,9 @@ class InPlaceReplaceUp extends EditorAction {
id: 'editor.action.inPlaceReplace.up',
label: nls.localize('InPlaceReplaceAction.previous.label', "Replace with Previous Value"),
alias: 'Replace with Previous Value',
precondition: EditorContextKeys.Writable,
precondition: EditorContextKeys.writable,
kbOpts: {
kbExpr: EditorContextKeys.TextFocus,
kbExpr: EditorContextKeys.textFocus,
primary: KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.US_COMMA
}
});
......@@ -163,9 +163,9 @@ class InPlaceReplaceDown extends EditorAction {
id: 'editor.action.inPlaceReplace.down',
label: nls.localize('InPlaceReplaceAction.next.label', "Replace with Next Value"),
alias: 'Replace with Next Value',
precondition: EditorContextKeys.Writable,
precondition: EditorContextKeys.writable,
kbOpts: {
kbExpr: EditorContextKeys.TextFocus,
kbExpr: EditorContextKeys.textFocus,
primary: KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.US_DOT
}
});
......
......@@ -153,7 +153,7 @@ export class IndentationToSpacesAction extends EditorAction {
id: IndentationToSpacesAction.ID,
label: nls.localize('indentationToSpaces', "Convert Indentation to Spaces"),
alias: 'Convert Indentation to Spaces',
precondition: EditorContextKeys.Writable
precondition: EditorContextKeys.writable
});
}
......@@ -180,7 +180,7 @@ export class IndentationToTabsAction extends EditorAction {
id: IndentationToTabsAction.ID,
label: nls.localize('indentationToTabs', "Convert Indentation to Tabs"),
alias: 'Convert Indentation to Tabs',
precondition: EditorContextKeys.Writable
precondition: EditorContextKeys.writable
});
}
......@@ -301,7 +301,7 @@ export class ReindentLinesAction extends EditorAction {
id: 'editor.action.reindentlines',
label: nls.localize('editor.reindentlines', "Reindent Lines"),
alias: 'Reindent Lines',
precondition: EditorContextKeys.Writable
precondition: EditorContextKeys.writable
});
}
......
......@@ -50,9 +50,9 @@ class CopyLinesUpAction extends AbstractCopyLinesAction {
id: 'editor.action.copyLinesUpAction',
label: nls.localize('lines.copyUp', "Copy Line Up"),
alias: 'Copy Line Up',
precondition: EditorContextKeys.Writable,
precondition: EditorContextKeys.writable,
kbOpts: {
kbExpr: EditorContextKeys.TextFocus,
kbExpr: EditorContextKeys.textFocus,
primary: KeyMod.Alt | KeyMod.Shift | KeyCode.UpArrow,
linux: { primary: KeyMod.CtrlCmd | KeyMod.Alt | KeyMod.Shift | KeyCode.UpArrow }
}
......@@ -67,9 +67,9 @@ class CopyLinesDownAction extends AbstractCopyLinesAction {
id: 'editor.action.copyLinesDownAction',
label: nls.localize('lines.copyDown', "Copy Line Down"),
alias: 'Copy Line Down',
precondition: EditorContextKeys.Writable,
precondition: EditorContextKeys.writable,
kbOpts: {
kbExpr: EditorContextKeys.TextFocus,
kbExpr: EditorContextKeys.textFocus,
primary: KeyMod.Alt | KeyMod.Shift | KeyCode.DownArrow,
linux: { primary: KeyMod.CtrlCmd | KeyMod.Alt | KeyMod.Shift | KeyCode.DownArrow }
}
......@@ -108,9 +108,9 @@ class MoveLinesUpAction extends AbstractMoveLinesAction {
id: 'editor.action.moveLinesUpAction',
label: nls.localize('lines.moveUp', "Move Line Up"),
alias: 'Move Line Up',
precondition: EditorContextKeys.Writable,
precondition: EditorContextKeys.writable,
kbOpts: {
kbExpr: EditorContextKeys.TextFocus,
kbExpr: EditorContextKeys.textFocus,
primary: KeyMod.Alt | KeyCode.UpArrow,
linux: { primary: KeyMod.Alt | KeyCode.UpArrow }
}
......@@ -125,9 +125,9 @@ class MoveLinesDownAction extends AbstractMoveLinesAction {
id: 'editor.action.moveLinesDownAction',
label: nls.localize('lines.moveDown', "Move Line Down"),
alias: 'Move Line Down',
precondition: EditorContextKeys.Writable,
precondition: EditorContextKeys.writable,
kbOpts: {
kbExpr: EditorContextKeys.TextFocus,
kbExpr: EditorContextKeys.textFocus,
primary: KeyMod.Alt | KeyCode.DownArrow,
linux: { primary: KeyMod.Alt | KeyCode.DownArrow }
}
......@@ -162,7 +162,7 @@ class SortLinesAscendingAction extends AbstractSortLinesAction {
id: 'editor.action.sortLinesAscending',
label: nls.localize('lines.sortAscending', "Sort Lines Ascending"),
alias: 'Sort Lines Ascending',
precondition: EditorContextKeys.Writable
precondition: EditorContextKeys.writable
});
}
}
......@@ -174,7 +174,7 @@ class SortLinesDescendingAction extends AbstractSortLinesAction {
id: 'editor.action.sortLinesDescending',
label: nls.localize('lines.sortDescending', "Sort Lines Descending"),
alias: 'Sort Lines Descending',
precondition: EditorContextKeys.Writable
precondition: EditorContextKeys.writable
});
}
}
......@@ -189,9 +189,9 @@ export class TrimTrailingWhitespaceAction extends EditorAction {
id: TrimTrailingWhitespaceAction.ID,
label: nls.localize('lines.trimTrailingWhitespace', "Trim Trailing Whitespace"),
alias: 'Trim Trailing Whitespace',
precondition: EditorContextKeys.Writable,
precondition: EditorContextKeys.writable,
kbOpts: {
kbExpr: EditorContextKeys.TextFocus,
kbExpr: EditorContextKeys.textFocus,
primary: KeyChord(KeyMod.CtrlCmd | KeyCode.KEY_K, KeyMod.CtrlCmd | KeyCode.KEY_X)
}
});
......@@ -263,9 +263,9 @@ class DeleteLinesAction extends AbstractRemoveLinesAction {
id: 'editor.action.deleteLines',
label: nls.localize('lines.delete', "Delete Line"),
alias: 'Delete Line',
precondition: EditorContextKeys.Writable,
precondition: EditorContextKeys.writable,
kbOpts: {
kbExpr: EditorContextKeys.TextFocus,
kbExpr: EditorContextKeys.textFocus,
primary: KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.KEY_K
}
});
......@@ -291,10 +291,10 @@ class IndentLinesAction extends HandlerEditorAction {
id: 'editor.action.indentLines',
label: nls.localize('lines.indent', "Indent Line"),
alias: 'Indent Line',
precondition: EditorContextKeys.Writable,
precondition: EditorContextKeys.writable,
handlerId: Handler.Indent,
kbOpts: {
kbExpr: EditorContextKeys.TextFocus,
kbExpr: EditorContextKeys.textFocus,
primary: KeyMod.CtrlCmd | KeyCode.US_CLOSE_SQUARE_BRACKET
}
});
......@@ -308,10 +308,10 @@ class OutdentLinesAction extends HandlerEditorAction {
id: 'editor.action.outdentLines',
label: nls.localize('lines.outdent', "Outdent Line"),
alias: 'Outdent Line',
precondition: EditorContextKeys.Writable,
precondition: EditorContextKeys.writable,
handlerId: Handler.Outdent,
kbOpts: {
kbExpr: EditorContextKeys.TextFocus,
kbExpr: EditorContextKeys.textFocus,
primary: KeyMod.CtrlCmd | KeyCode.US_OPEN_SQUARE_BRACKET
}
});
......@@ -325,10 +325,10 @@ class InsertLineBeforeAction extends HandlerEditorAction {
id: 'editor.action.insertLineBefore',
label: nls.localize('lines.insertBefore', "Insert Line Above"),
alias: 'Insert Line Above',
precondition: EditorContextKeys.Writable,
precondition: EditorContextKeys.writable,
handlerId: Handler.LineInsertBefore,
kbOpts: {
kbExpr: EditorContextKeys.TextFocus,
kbExpr: EditorContextKeys.textFocus,
primary: KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.Enter
}
});
......@@ -342,10 +342,10 @@ class InsertLineAfterAction extends HandlerEditorAction {
id: 'editor.action.insertLineAfter',
label: nls.localize('lines.insertAfter', "Insert Line Below"),
alias: 'Insert Line Below',
precondition: EditorContextKeys.Writable,
precondition: EditorContextKeys.writable,
handlerId: Handler.LineInsertAfter,
kbOpts: {
kbExpr: EditorContextKeys.TextFocus,
kbExpr: EditorContextKeys.textFocus,
primary: KeyMod.CtrlCmd | KeyCode.Enter
}
});
......@@ -396,9 +396,9 @@ export class DeleteAllLeftAction extends AbstractDeleteAllToBoundaryAction {
id: 'deleteAllLeft',
label: nls.localize('lines.deleteAllLeft', "Delete All Left"),
alias: 'Delete All Left',
precondition: EditorContextKeys.Writable,
precondition: EditorContextKeys.writable,
kbOpts: {
kbExpr: EditorContextKeys.TextFocus,
kbExpr: EditorContextKeys.textFocus,
primary: null,
mac: { primary: KeyMod.CtrlCmd | KeyCode.Backspace }
}
......@@ -450,9 +450,9 @@ export class DeleteAllRightAction extends AbstractDeleteAllToBoundaryAction {
id: 'deleteAllRight',
label: nls.localize('lines.deleteAllRight', "Delete All Right"),
alias: 'Delete All Right',
precondition: EditorContextKeys.Writable,
precondition: EditorContextKeys.writable,
kbOpts: {
kbExpr: EditorContextKeys.TextFocus,
kbExpr: EditorContextKeys.textFocus,
primary: null,
mac: { primary: KeyMod.WinCtrl | KeyCode.KEY_K, secondary: [KeyMod.CtrlCmd | KeyCode.Delete] }
}
......@@ -508,9 +508,9 @@ export class JoinLinesAction extends EditorAction {
id: 'editor.action.joinLines',
label: nls.localize('lines.joinLines', "Join Lines"),
alias: 'Join Lines',
precondition: EditorContextKeys.Writable,
precondition: EditorContextKeys.writable,
kbOpts: {
kbExpr: EditorContextKeys.TextFocus,
kbExpr: EditorContextKeys.textFocus,
primary: 0,
mac: { primary: KeyMod.WinCtrl | KeyCode.KEY_J }
}
......@@ -656,7 +656,7 @@ export class TransposeAction extends EditorAction {
id: 'editor.action.transpose',
label: nls.localize('editor.transpose', "Transpose characters around the cursor"),
alias: 'Transpose characters around the cursor',
precondition: EditorContextKeys.Writable
precondition: EditorContextKeys.writable
});
}
......@@ -738,7 +738,7 @@ export class UpperCaseAction extends AbstractCaseAction {
id: 'editor.action.transformToUppercase',
label: nls.localize('editor.transformToUppercase', "Transform to Uppercase"),
alias: 'Transform to Uppercase',
precondition: EditorContextKeys.Writable
precondition: EditorContextKeys.writable
});
}
......@@ -754,7 +754,7 @@ export class LowerCaseAction extends AbstractCaseAction {
id: 'editor.action.transformToLowercase',
label: nls.localize('editor.transformToLowercase', "Transform to Lowercase"),
alias: 'Transform to Lowercase',
precondition: EditorContextKeys.Writable
precondition: EditorContextKeys.writable
});
}
......
......@@ -21,7 +21,7 @@ class InsertCursorAbove extends HandlerEditorAction {
precondition: null,
handlerId: Handler.AddCursorUp,
kbOpts: {
kbExpr: EditorContextKeys.TextFocus,
kbExpr: EditorContextKeys.textFocus,
primary: KeyMod.CtrlCmd | KeyMod.Alt | KeyCode.UpArrow,
linux: {
primary: KeyMod.Shift | KeyMod.Alt | KeyCode.UpArrow,
......@@ -42,7 +42,7 @@ class InsertCursorBelow extends HandlerEditorAction {
precondition: null,
handlerId: Handler.AddCursorDown,
kbOpts: {
kbExpr: EditorContextKeys.TextFocus,
kbExpr: EditorContextKeys.textFocus,
primary: KeyMod.CtrlCmd | KeyMod.Alt | KeyCode.DownArrow,
linux: {
primary: KeyMod.Shift | KeyMod.Alt | KeyCode.DownArrow,
......@@ -63,7 +63,7 @@ class InsertCursorAtEndOfEachLineSelected extends EditorAction {
alias: 'Add Cursors to Line Ends',
precondition: null,
kbOpts: {
kbExpr: EditorContextKeys.TextFocus,
kbExpr: EditorContextKeys.textFocus,
primary: KeyMod.Shift | KeyMod.Alt | KeyCode.KEY_I
}
});
......
......@@ -9,7 +9,7 @@ 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 } from 'vs/editor/common/editorCommon';
import { EditorContextKeys, ModeContextKeys } from 'vs/editor/common/editorContextKeys';
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 { ICodeEditor } from 'vs/editor/browser/editorBrowser';
......@@ -67,9 +67,9 @@ export class TriggerParameterHintsAction extends EditorAction {
id: 'editor.action.triggerParameterHints',
label: nls.localize('parameterHints.trigger.label', "Trigger Parameter Hints"),
alias: 'Trigger Parameter Hints',
precondition: ModeContextKeys.hasSignatureHelpProvider,
precondition: EditorContextKeys.hasSignatureHelpProvider,
kbOpts: {
kbExpr: EditorContextKeys.TextFocus,
kbExpr: EditorContextKeys.textFocus,
primary: KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.Space
}
});
......@@ -93,7 +93,7 @@ CommonEditorRegistry.registerEditorCommand(new ParameterHintsCommand({
handler: x => x.cancel(),
kbOpts: {
weight: weight,
kbExpr: EditorContextKeys.TextFocus,
kbExpr: EditorContextKeys.textFocus,
primary: KeyCode.Escape,
secondary: [KeyMod.Shift | KeyCode.Escape]
}
......@@ -104,7 +104,7 @@ CommonEditorRegistry.registerEditorCommand(new ParameterHintsCommand({
handler: x => x.previous(),
kbOpts: {
weight: weight,
kbExpr: EditorContextKeys.TextFocus,
kbExpr: EditorContextKeys.textFocus,
primary: KeyCode.UpArrow,
secondary: [KeyMod.Alt | KeyCode.UpArrow],
mac: { primary: KeyCode.UpArrow, secondary: [KeyMod.Alt | KeyCode.UpArrow, KeyMod.WinCtrl | KeyCode.KEY_P] }
......@@ -116,7 +116,7 @@ CommonEditorRegistry.registerEditorCommand(new ParameterHintsCommand({
handler: x => x.next(),
kbOpts: {
weight: weight,
kbExpr: EditorContextKeys.TextFocus,
kbExpr: EditorContextKeys.textFocus,
primary: KeyCode.DownArrow,
secondary: [KeyMod.Alt | KeyCode.DownArrow],
mac: { primary: KeyCode.DownArrow, secondary: [KeyMod.Alt | KeyCode.DownArrow, KeyMod.WinCtrl | KeyCode.KEY_N] }
......
......@@ -13,7 +13,7 @@ import { ContextKeyExpr, IContextKeyService } from 'vs/platform/contextkey/commo
import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding';
import { IMarkerService } from 'vs/platform/markers/common/markers';
import { ICommonCodeEditor, IEditorContribution, IReadOnlyModel } from 'vs/editor/common/editorCommon';
import { EditorContextKeys, ModeContextKeys } from 'vs/editor/common/editorContextKeys';
import { EditorContextKeys } from 'vs/editor/common/editorContextKeys';
import { Range } from 'vs/editor/common/core/range';
import { editorAction, ServicesAccessor, EditorAction } from 'vs/editor/common/editorCommonExtensions';
import { ICodeEditor } from 'vs/editor/browser/editorBrowser';
......@@ -120,9 +120,9 @@ export class QuickFixAction extends EditorAction {
id: QuickFixAction.Id,
label: nls.localize('quickfix.trigger.label', "Quick Fix"),
alias: 'Quick Fix',
precondition: ContextKeyExpr.and(EditorContextKeys.Writable, ModeContextKeys.hasCodeActionsProvider),
precondition: ContextKeyExpr.and(EditorContextKeys.writable, EditorContextKeys.hasCodeActionsProvider),
kbOpts: {
kbExpr: EditorContextKeys.TextFocus,
kbExpr: EditorContextKeys.textFocus,
primary: KeyMod.CtrlCmd | KeyCode.US_DOT
}
});
......
......@@ -151,7 +151,7 @@ export class GotoLineAction extends BaseEditorQuickOpenAction {
alias: 'Go to Line...',
precondition: null,
kbOpts: {
kbExpr: EditorContextKeys.Focus,
kbExpr: EditorContextKeys.focus,
primary: KeyMod.CtrlCmd | KeyCode.KEY_G,
mac: { primary: KeyMod.WinCtrl | KeyCode.KEY_G }
}
......
......@@ -78,7 +78,7 @@ export class QuickCommandAction extends BaseEditorQuickOpenAction {
alias: 'Command Palette',
precondition: null,
kbOpts: {
kbExpr: EditorContextKeys.Focus,
kbExpr: EditorContextKeys.focus,
primary: (browser.isIE ? KeyMod.Alt | KeyCode.F1 : KeyCode.F1)
},
menuOpts: {
......
......@@ -14,7 +14,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 { ICommonCodeEditor } from 'vs/editor/common/editorCommon';
import { EditorContextKeys, ModeContextKeys } from 'vs/editor/common/editorContextKeys';
import { EditorContextKeys } from 'vs/editor/common/editorContextKeys';
import { SymbolInformation, DocumentSymbolProviderRegistry, symbolKindToCssClass } from 'vs/editor/common/modes';
import { BaseEditorQuickOpenAction, IDecorator } from './editorQuickOpen';
import { getDocumentSymbols, IOutline } from 'vs/editor/contrib/quickOpen/common/quickOpen';
......@@ -117,9 +117,9 @@ export class QuickOutlineAction extends BaseEditorQuickOpenAction {
id: 'editor.action.quickOutline',
label: nls.localize('QuickOutlineAction.label', "Go to Symbol..."),
alias: 'Go to Symbol...',
precondition: ModeContextKeys.hasDocumentSymbolProvider,
precondition: EditorContextKeys.hasDocumentSymbolProvider,
kbOpts: {
kbExpr: EditorContextKeys.Focus,
kbExpr: EditorContextKeys.focus,
primary: KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.KEY_O
},
menuOpts: {
......
......@@ -23,7 +23,7 @@ import { ReferencesController, RequestOptions, ctxReferenceSearchVisible } from
import { ReferencesModel } from './referencesModel';
import { asWinJsPromise } from 'vs/base/common/async';
import { onUnexpectedExternalError } from 'vs/base/common/errors';
import { EditorContextKeys, ModeContextKeys } from 'vs/editor/common/editorContextKeys';
import { EditorContextKeys } from 'vs/editor/common/editorContextKeys';
const defaultReferenceSearchOptions: RequestOptions = {
getMetaTitle(model) {
......@@ -63,11 +63,11 @@ export class ReferenceAction extends EditorAction {
label: nls.localize('references.action.label', "Find All References"),
alias: 'Find All References',
precondition: ContextKeyExpr.and(
ModeContextKeys.hasReferenceProvider,
EditorContextKeys.hasReferenceProvider,
PeekContext.notInPeekEditor,
ModeContextKeys.isInEmbeddedEditor.toNegated()),
EditorContextKeys.isInEmbeddedEditor.toNegated()),
kbOpts: {
kbExpr: EditorContextKeys.TextFocus,
kbExpr: EditorContextKeys.textFocus,
primary: KeyMod.Shift | KeyCode.F12
},
menuOpts: {
......
......@@ -17,7 +17,7 @@ import { IProgressService } from 'vs/platform/progress/common/progress';
import { editorAction, 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, ModeContextKeys } from 'vs/editor/common/editorContextKeys';
import { EditorContextKeys } from 'vs/editor/common/editorContextKeys';
import { BulkEdit, createBulkEdit } from 'vs/editor/common/services/bulkEdit';
import { ICodeEditor } from 'vs/editor/browser/editorBrowser';
import RenameInputField from './renameInputField';
......@@ -216,9 +216,9 @@ export class RenameAction extends EditorAction {
id: 'editor.action.rename',
label: nls.localize('rename.label', "Rename Symbol"),
alias: 'Rename Symbol',
precondition: ContextKeyExpr.and(EditorContextKeys.Writable, ModeContextKeys.hasRenameProvider),
precondition: ContextKeyExpr.and(EditorContextKeys.writable, EditorContextKeys.hasRenameProvider),
kbOpts: {
kbExpr: EditorContextKeys.TextFocus,
kbExpr: EditorContextKeys.textFocus,
primary: KeyCode.F2
},
menuOpts: {
......@@ -245,7 +245,7 @@ CommonEditorRegistry.registerEditorCommand(new RenameCommand({
handler: x => x.acceptRenameInput(),
kbOpts: {
weight: CommonEditorRegistry.commandWeight(99),
kbExpr: EditorContextKeys.Focus,
kbExpr: EditorContextKeys.focus,
primary: KeyCode.Enter
}
}));
......@@ -256,7 +256,7 @@ CommonEditorRegistry.registerEditorCommand(new RenameCommand({
handler: x => x.cancelRenameInput(),
kbOpts: {
weight: CommonEditorRegistry.commandWeight(99),
kbExpr: EditorContextKeys.Focus,
kbExpr: EditorContextKeys.focus,
primary: KeyCode.Escape,
secondary: [KeyMod.Shift | KeyCode.Escape]
}
......
......@@ -172,7 +172,7 @@ class GrowSelectionAction extends AbstractSmartSelect {
alias: 'Expand Select',
precondition: null,
kbOpts: {
kbExpr: EditorContextKeys.TextFocus,
kbExpr: EditorContextKeys.textFocus,
primary: KeyMod.Shift | KeyMod.Alt | KeyCode.RightArrow,
mac: { primary: KeyMod.CtrlCmd | KeyMod.WinCtrl | KeyMod.Shift | KeyCode.RightArrow }
}
......@@ -189,7 +189,7 @@ class ShrinkSelectionAction extends AbstractSmartSelect {
alias: 'Shrink Select',
precondition: null,
kbOpts: {
kbExpr: EditorContextKeys.TextFocus,
kbExpr: EditorContextKeys.textFocus,
primary: KeyMod.Shift | KeyMod.Alt | KeyCode.LeftArrow,
mac: { primary: KeyMod.CtrlCmd | KeyMod.WinCtrl | KeyMod.Shift | KeyCode.LeftArrow }
}
......
......@@ -725,7 +725,7 @@ CommonEditorRegistry.registerEditorCommand(new SnippetCommand({
handler: x => x.jumpToNextPlaceholder(),
kbOpts: {
weight: CommonEditorRegistry.commandWeight(30),
kbExpr: EditorContextKeys.TextFocus,
kbExpr: EditorContextKeys.textFocus,
primary: KeyCode.Tab
}
}));
......@@ -735,7 +735,7 @@ CommonEditorRegistry.registerEditorCommand(new SnippetCommand({
handler: x => x.jumpToPrevPlaceholder(),
kbOpts: {
weight: CommonEditorRegistry.commandWeight(30),
kbExpr: EditorContextKeys.TextFocus,
kbExpr: EditorContextKeys.textFocus,
primary: KeyMod.Shift | KeyCode.Tab
}
}));
......@@ -745,7 +745,7 @@ CommonEditorRegistry.registerEditorCommand(new SnippetCommand({
handler: x => x.acceptSnippet(),
kbOpts: {
weight: CommonEditorRegistry.commandWeight(30),
kbExpr: EditorContextKeys.TextFocus,
kbExpr: EditorContextKeys.textFocus,
primary: KeyCode.Enter
}
}));
......@@ -755,7 +755,7 @@ CommonEditorRegistry.registerEditorCommand(new SnippetCommand({
handler: x => x.leaveSnippet(),
kbOpts: {
weight: CommonEditorRegistry.commandWeight(30),
kbExpr: EditorContextKeys.TextFocus,
kbExpr: EditorContextKeys.textFocus,
primary: KeyCode.Escape,
secondary: [KeyMod.Shift | KeyCode.Escape]
}
......
......@@ -14,7 +14,7 @@ import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry';
import { ContextKeyExpr, IContextKeyService } from 'vs/platform/contextkey/common/contextkey';
import { ICommandService } from 'vs/platform/commands/common/commands';
import { ICommonCodeEditor, IEditorContribution } from 'vs/editor/common/editorCommon';
import { EditorContextKeys, ModeContextKeys } from 'vs/editor/common/editorContextKeys';
import { EditorContextKeys } from 'vs/editor/common/editorContextKeys';
import { editorAction, 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';
......@@ -274,9 +274,9 @@ export class TriggerSuggestAction extends EditorAction {
id: 'editor.action.triggerSuggest',
label: nls.localize('suggest.trigger.label', "Trigger Suggest"),
alias: 'Trigger Suggest',
precondition: ContextKeyExpr.and(EditorContextKeys.Writable, ModeContextKeys.hasCompletionItemProvider),
precondition: ContextKeyExpr.and(EditorContextKeys.writable, EditorContextKeys.hasCompletionItemProvider),
kbOpts: {
kbExpr: EditorContextKeys.TextFocus,
kbExpr: EditorContextKeys.textFocus,
primary: KeyMod.CtrlCmd | KeyCode.Space,
mac: { primary: KeyMod.WinCtrl | KeyCode.Space }
}
......@@ -305,7 +305,7 @@ CommonEditorRegistry.registerEditorCommand(new SuggestCommand({
handler: x => x.acceptSelectedSuggestion(),
kbOpts: {
weight: weight,
kbExpr: EditorContextKeys.TextFocus,
kbExpr: EditorContextKeys.textFocus,
primary: KeyCode.Tab
}
}));
......@@ -316,7 +316,7 @@ CommonEditorRegistry.registerEditorCommand(new SuggestCommand({
handler: x => x.acceptSelectedSuggestion(),
kbOpts: {
weight: weight,
kbExpr: ContextKeyExpr.and(EditorContextKeys.TextFocus, SuggestContext.AcceptSuggestionsOnEnter),
kbExpr: ContextKeyExpr.and(EditorContextKeys.textFocus, SuggestContext.AcceptSuggestionsOnEnter),
primary: KeyCode.Enter
}
}));
......@@ -327,7 +327,7 @@ CommonEditorRegistry.registerEditorCommand(new SuggestCommand({
handler: x => x.cancelSuggestWidget(),
kbOpts: {
weight: weight,
kbExpr: EditorContextKeys.TextFocus,
kbExpr: EditorContextKeys.textFocus,
primary: KeyCode.Escape,
secondary: [KeyMod.Shift | KeyCode.Escape]
}
......@@ -339,7 +339,7 @@ CommonEditorRegistry.registerEditorCommand(new SuggestCommand({
handler: c => c.selectNextSuggestion(),
kbOpts: {
weight: weight,
kbExpr: EditorContextKeys.TextFocus,
kbExpr: EditorContextKeys.textFocus,
primary: KeyCode.DownArrow,
secondary: [KeyMod.Alt | KeyCode.DownArrow],
mac: { primary: KeyCode.DownArrow, secondary: [KeyMod.Alt | KeyCode.DownArrow, KeyMod.WinCtrl | KeyCode.KEY_N] }
......@@ -352,7 +352,7 @@ CommonEditorRegistry.registerEditorCommand(new SuggestCommand({
handler: c => c.selectNextPageSuggestion(),
kbOpts: {
weight: weight,
kbExpr: EditorContextKeys.TextFocus,
kbExpr: EditorContextKeys.textFocus,
primary: KeyCode.PageDown,
secondary: [KeyMod.Alt | KeyCode.PageDown]
}
......@@ -364,7 +364,7 @@ CommonEditorRegistry.registerEditorCommand(new SuggestCommand({
handler: c => c.selectLastSuggestion(),
kbOpts: {
weight: weight,
kbExpr: EditorContextKeys.TextFocus,
kbExpr: EditorContextKeys.textFocus,
primary: KeyCode.End
}
}));
......@@ -375,7 +375,7 @@ CommonEditorRegistry.registerEditorCommand(new SuggestCommand({
handler: c => c.selectPrevSuggestion(),
kbOpts: {
weight: weight,
kbExpr: EditorContextKeys.TextFocus,
kbExpr: EditorContextKeys.textFocus,
primary: KeyCode.UpArrow,
secondary: [KeyMod.Alt | KeyCode.UpArrow],
mac: { primary: KeyCode.UpArrow, secondary: [KeyMod.Alt | KeyCode.UpArrow, KeyMod.WinCtrl | KeyCode.KEY_P] }
......@@ -388,7 +388,7 @@ CommonEditorRegistry.registerEditorCommand(new SuggestCommand({
handler: c => c.selectPrevPageSuggestion(),
kbOpts: {
weight: weight,
kbExpr: EditorContextKeys.TextFocus,
kbExpr: EditorContextKeys.textFocus,
primary: KeyCode.PageUp,
secondary: [KeyMod.Alt | KeyCode.PageUp]
}
......@@ -400,7 +400,7 @@ CommonEditorRegistry.registerEditorCommand(new SuggestCommand({
handler: c => c.selectFirstSuggestion(),
kbOpts: {
weight: weight,
kbExpr: EditorContextKeys.TextFocus,
kbExpr: EditorContextKeys.textFocus,
primary: KeyCode.Home
}
}));
......@@ -411,7 +411,7 @@ CommonEditorRegistry.registerEditorCommand(new SuggestCommand({
handler: x => x.toggleSuggestionDetails(),
kbOpts: {
weight: weight,
kbExpr: EditorContextKeys.TextFocus,
kbExpr: EditorContextKeys.textFocus,
primary: KeyMod.CtrlCmd | KeyCode.Space,
mac: { primary: KeyMod.WinCtrl | KeyCode.Space }
}
......
......@@ -94,7 +94,7 @@ export class CursorWordStartLeft extends WordLeftCommand {
id: 'cursorWordStartLeft',
precondition: null,
kbOpts: {
kbExpr: EditorContextKeys.TextFocus,
kbExpr: EditorContextKeys.textFocus,
primary: KeyMod.CtrlCmd | KeyCode.LeftArrow,
mac: { primary: KeyMod.Alt | KeyCode.LeftArrow }
}
......@@ -135,7 +135,7 @@ export class CursorWordStartLeftSelect extends WordLeftCommand {
id: 'cursorWordStartLeftSelect',
precondition: null,
kbOpts: {
kbExpr: EditorContextKeys.TextFocus,
kbExpr: EditorContextKeys.textFocus,
primary: KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.LeftArrow,
mac: { primary: KeyMod.Alt | KeyMod.Shift | KeyCode.LeftArrow }
}
......@@ -188,7 +188,7 @@ export class CursorWordEndRight extends WordRightCommand {
id: 'cursorWordEndRight',
precondition: null,
kbOpts: {
kbExpr: EditorContextKeys.TextFocus,
kbExpr: EditorContextKeys.textFocus,
primary: KeyMod.CtrlCmd | KeyCode.RightArrow,
mac: { primary: KeyMod.Alt | KeyCode.RightArrow }
}
......@@ -229,7 +229,7 @@ export class CursorWordEndRightSelect extends WordRightCommand {
id: 'cursorWordEndRightSelect',
precondition: null,
kbOpts: {
kbExpr: EditorContextKeys.TextFocus,
kbExpr: EditorContextKeys.textFocus,
primary: KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.RightArrow,
mac: { primary: KeyMod.Alt | KeyMod.Shift | KeyCode.RightArrow }
}
......@@ -310,7 +310,7 @@ export class DeleteWordStartLeft extends DeleteWordLeftCommand {
whitespaceHeuristics: false,
wordNavigationType: WordNavigationType.WordStart,
id: 'deleteWordStartLeft',
precondition: EditorContextKeys.Writable
precondition: EditorContextKeys.writable
});
}
}
......@@ -322,7 +322,7 @@ export class DeleteWordEndLeft extends DeleteWordLeftCommand {
whitespaceHeuristics: false,
wordNavigationType: WordNavigationType.WordEnd,
id: 'deleteWordEndLeft',
precondition: EditorContextKeys.Writable
precondition: EditorContextKeys.writable
});
}
}
......@@ -334,9 +334,9 @@ export class DeleteWordLeft extends DeleteWordLeftCommand {
whitespaceHeuristics: true,
wordNavigationType: WordNavigationType.WordStart,
id: 'deleteWordLeft',
precondition: EditorContextKeys.Writable,
precondition: EditorContextKeys.writable,
kbOpts: {
kbExpr: EditorContextKeys.TextFocus,
kbExpr: EditorContextKeys.textFocus,
primary: KeyMod.CtrlCmd | KeyCode.Backspace,
mac: { primary: KeyMod.Alt | KeyCode.Backspace }
}
......@@ -351,7 +351,7 @@ export class DeleteWordStartRight extends DeleteWordRightCommand {
whitespaceHeuristics: false,
wordNavigationType: WordNavigationType.WordStart,
id: 'deleteWordStartRight',
precondition: EditorContextKeys.Writable
precondition: EditorContextKeys.writable
});
}
}
......@@ -363,7 +363,7 @@ export class DeleteWordEndRight extends DeleteWordRightCommand {
whitespaceHeuristics: false,
wordNavigationType: WordNavigationType.WordEnd,
id: 'deleteWordEndRight',
precondition: EditorContextKeys.Writable
precondition: EditorContextKeys.writable
});
}
}
......@@ -375,9 +375,9 @@ export class DeleteWordRight extends DeleteWordRightCommand {
whitespaceHeuristics: true,
wordNavigationType: WordNavigationType.WordEnd,
id: 'deleteWordRight',
precondition: EditorContextKeys.Writable,
precondition: EditorContextKeys.writable,
kbOpts: {
kbExpr: EditorContextKeys.TextFocus,
kbExpr: EditorContextKeys.textFocus,
primary: KeyMod.CtrlCmd | KeyCode.Delete,
mac: { primary: KeyMod.Alt | KeyCode.Delete }
}
......
......@@ -52,7 +52,7 @@ function registerActiveEditorMoveCommand(): void {
KeybindingsRegistry.registerCommandAndKeybindingRule({
id: EditorCommands.MoveActiveEditor,
weight: KeybindingsRegistry.WEIGHT.workbenchContrib(),
when: EditorContextKeys.TextFocus,
when: EditorContextKeys.textFocus,
primary: null,
handler: (accessor, args: any) => moveActiveEditor(args, accessor),
description: {
......
......@@ -24,7 +24,7 @@ class ToggleBreakpointAction extends EditorAction {
alias: 'Debug: Toggle Breakpoint',
precondition: null,
kbOpts: {
kbExpr: EditorContextKeys.TextFocus,
kbExpr: EditorContextKeys.textFocus,
primary: KeyCode.F9
}
});
......@@ -76,7 +76,7 @@ class ToggleColumnBreakpointAction extends EditorAction {
alias: 'Debug: Column Breakpoint',
precondition: null,
kbOpts: {
kbExpr: EditorContextKeys.TextFocus,
kbExpr: EditorContextKeys.textFocus,
primary: KeyMod.Shift | KeyCode.F9
}
});
......@@ -95,7 +95,7 @@ class ToggleColumnBreakpointContextMenuAction extends EditorAction {
id: 'editor.debug.action.toggleColumnBreakpointContextMenu',
label: nls.localize('columnBreakpoint', "Add Column Breakpoint"),
alias: 'Toggle Column Breakpoint',
precondition: ContextKeyExpr.and(CONTEXT_IN_DEBUG_MODE, CONTEXT_NOT_IN_DEBUG_REPL, EditorContextKeys.Writable),
precondition: ContextKeyExpr.and(CONTEXT_IN_DEBUG_MODE, CONTEXT_NOT_IN_DEBUG_REPL, EditorContextKeys.writable),
menuOpts: {
group: 'debug',
order: 1
......@@ -139,7 +139,7 @@ class RunToCursorAction extends EditorAction {
id: 'editor.debug.action.runToCursor',
label: nls.localize('runToCursor', "Run to Cursor"),
alias: 'Debug: Run to Cursor',
precondition: ContextKeyExpr.and(CONTEXT_IN_DEBUG_MODE, CONTEXT_NOT_IN_DEBUG_REPL, EditorContextKeys.Writable, CONTEXT_DEBUG_STATE.isEqualTo('stopped')),
precondition: ContextKeyExpr.and(CONTEXT_IN_DEBUG_MODE, CONTEXT_NOT_IN_DEBUG_REPL, EditorContextKeys.writable, CONTEXT_DEBUG_STATE.isEqualTo('stopped')),
menuOpts: {
group: 'debug',
order: 2
......@@ -182,7 +182,7 @@ class SelectionToReplAction extends EditorAction {
id: 'editor.debug.action.selectionToRepl',
label: nls.localize('debugEvaluate', "Debug: Evaluate"),
alias: 'Debug: Evaluate',
precondition: ContextKeyExpr.and(EditorContextKeys.HasNonEmptySelection, CONTEXT_IN_DEBUG_MODE, CONTEXT_NOT_IN_DEBUG_REPL),
precondition: ContextKeyExpr.and(EditorContextKeys.hasNonEmptySelection, CONTEXT_IN_DEBUG_MODE, CONTEXT_NOT_IN_DEBUG_REPL),
menuOpts: {
group: 'debug',
order: 0
......@@ -209,7 +209,7 @@ class SelectionToWatchExpressionsAction extends EditorAction {
id: 'editor.debug.action.selectionToWatch',
label: nls.localize('debugAddToWatch', "Debug: Add to Watch"),
alias: 'Debug: Add to Watch',
precondition: ContextKeyExpr.and(EditorContextKeys.HasNonEmptySelection, CONTEXT_IN_DEBUG_MODE, CONTEXT_NOT_IN_DEBUG_REPL),
precondition: ContextKeyExpr.and(EditorContextKeys.hasNonEmptySelection, CONTEXT_IN_DEBUG_MODE, CONTEXT_NOT_IN_DEBUG_REPL),
menuOpts: {
group: 'debug',
order: 1
......@@ -236,7 +236,7 @@ class ShowDebugHoverAction extends EditorAction {
alias: 'Debug: Show Hover',
precondition: CONTEXT_IN_DEBUG_MODE,
kbOpts: {
kbExpr: EditorContextKeys.TextFocus,
kbExpr: EditorContextKeys.textFocus,
primary: KeyChord(KeyMod.CtrlCmd | KeyCode.KEY_K, KeyMod.CtrlCmd | KeyCode.KEY_I)
}
});
......@@ -262,7 +262,7 @@ class CloseBreakpointWidgetCommand extends EditorCommand {
precondition: CONTEXT_BREAKPOINT_WIDGET_VISIBLE,
kbOpts: {
weight: CommonEditorRegistry.commandWeight(8),
kbExpr: EditorContextKeys.Focus,
kbExpr: EditorContextKeys.focus,
primary: KeyCode.Escape,
secondary: [KeyMod.Shift | KeyCode.Escape]
}
......
......@@ -303,7 +303,7 @@ class ReplHistoryPreviousAction extends EditorAction {
alias: 'History Previous',
precondition: debug.CONTEXT_IN_DEBUG_REPL,
kbOpts: {
kbExpr: ContextKeyExpr.and(EditorContextKeys.TextFocus, debug.CONTEXT_ON_FIRST_DEBUG_REPL_LINE),
kbExpr: ContextKeyExpr.and(EditorContextKeys.textFocus, debug.CONTEXT_ON_FIRST_DEBUG_REPL_LINE),
primary: KeyCode.UpArrow,
weight: 50
},
......@@ -328,7 +328,7 @@ class ReplHistoryNextAction extends EditorAction {
alias: 'History Next',
precondition: debug.CONTEXT_IN_DEBUG_REPL,
kbOpts: {
kbExpr: ContextKeyExpr.and(EditorContextKeys.TextFocus, debug.CONTEXT_ON_LAST_DEBUG_REPL_LINE),
kbExpr: ContextKeyExpr.and(EditorContextKeys.textFocus, debug.CONTEXT_ON_LAST_DEBUG_REPL_LINE),
primary: KeyCode.DownArrow,
weight: 50
},
......@@ -353,7 +353,7 @@ class AcceptReplInputAction extends EditorAction {
alias: 'REPL Accept Input',
precondition: debug.CONTEXT_IN_DEBUG_REPL,
kbOpts: {
kbExpr: EditorContextKeys.TextFocus,
kbExpr: EditorContextKeys.textFocus,
primary: KeyCode.Enter
}
});
......@@ -372,7 +372,7 @@ CommonEditorRegistry.registerEditorCommand(new SuggestCommand({
handler: x => x.acceptSelectedSuggestion(),
kbOpts: {
weight: 50,
kbExpr: EditorContextKeys.TextFocus,
kbExpr: EditorContextKeys.textFocus,
primary: KeyCode.RightArrow
}
}));
......@@ -30,7 +30,7 @@ class EncodeDecodeDataUrlAction extends EmmetEditorAction {
id: 'editor.emmet.action.encodeDecodeDataUrl',
label: nls.localize('encodeDecodeDataUrl', "Emmet: Encode\\Decode data:URL image"),
alias: 'Emmet: Encode\\Decode data:URL image',
precondition: EditorContextKeys.Writable,
precondition: EditorContextKeys.writable,
actionName: 'encode_decode_data_url'
});
}
......
......@@ -27,10 +27,10 @@ class ExpandAbbreviationAction extends BasicEmmetEditorAction {
{
primary: KeyCode.Tab,
kbExpr: ContextKeyExpr.and(
EditorContextKeys.TextFocus,
EditorContextKeys.HasOnlyEmptySelection,
EditorContextKeys.HasSingleSelection,
EditorContextKeys.TabDoesNotMoveFocus,
EditorContextKeys.textFocus,
EditorContextKeys.hasOnlyEmptySelection,
EditorContextKeys.hasSingleSelection,
EditorContextKeys.tabDoesNotMoveFocus,
ContextKeyExpr.has('config.emmet.triggerExpansionOnTab')
)
}
......
......@@ -20,7 +20,7 @@ class UpdateTagAction extends EmmetEditorAction {
id: 'editor.emmet.action.updateTag',
label: nls.localize('updateTag', "Emmet: Update Tag"),
alias: 'Emmet: Update Tag',
precondition: EditorContextKeys.Writable,
precondition: EditorContextKeys.writable,
actionName: 'update_tag'
});
}
......
......@@ -20,7 +20,7 @@ class WrapWithAbbreviationAction extends EmmetEditorAction {
id: 'editor.emmet.action.wrapWithAbbreviation',
label: nls.localize('wrapWithAbbreviationAction', "Emmet: Wrap with Abbreviation"),
alias: 'Emmet: Wrap with Abbreviation',
precondition: EditorContextKeys.Writable,
precondition: EditorContextKeys.writable,
actionName: 'wrap_with_abbreviation'
});
}
......
......@@ -281,7 +281,7 @@ export class BasicEmmetEditorAction extends EmmetEditorAction {
id,
label,
alias,
precondition: EditorContextKeys.Writable,
precondition: EditorContextKeys.writable,
kbOpts,
actionName
});
......
......@@ -310,9 +310,9 @@ export class DefineKeybindingAction extends EditorAction {
id: DefineKeybindingAction.ID,
label: nls.localize('DefineKeybindingAction', "Define Keybinding"),
alias: 'Define Keybinding',
precondition: ContextKeyExpr.and(EditorContextKeys.Writable, EditorContextKeys.LanguageId.isEqualTo('json')),
precondition: ContextKeyExpr.and(EditorContextKeys.writable, EditorContextKeys.languageId.isEqualTo('json')),
kbOpts: {
kbExpr: EditorContextKeys.TextFocus,
kbExpr: EditorContextKeys.textFocus,
primary: KeyChord(KeyMod.CtrlCmd | KeyCode.KEY_K, KeyMod.CtrlCmd | KeyCode.KEY_K)
}
});
......
......@@ -59,7 +59,7 @@ class InsertSnippetAction extends EditorAction {
id: 'editor.action.insertSnippet',
label: nls.localize('snippet.suggestions.label', "Insert Snippet"),
alias: 'Insert Snippet',
precondition: EditorContextKeys.Writable
precondition: EditorContextKeys.writable
});
}
......
......@@ -96,8 +96,8 @@ CommonEditorRegistry.registerEditorCommand(new TabCompletionCommand({
kbOpts: {
weight: KeybindingsRegistry.WEIGHT.editorContrib(),
kbExpr: ContextKeyExpr.and(
EditorContextKeys.TextFocus,
EditorContextKeys.TabDoesNotMoveFocus,
EditorContextKeys.textFocus,
EditorContextKeys.tabDoesNotMoveFocus,
CONTEXT_SNIPPET_MODE.toNegated(),
ContextKeyExpr.has('config.editor.tabCompletion')
),
......
......@@ -40,13 +40,13 @@ Registry.as<IWorkbenchContributionsRegistry>(WorkbenchExtensions.Workbench)
.registerWorkbenchContribution(WalkThroughSnippetContentProvider);
Registry.as<IWorkbenchActionRegistry>(Extensions.WorkbenchActions)
.registerWorkbenchAction(new SyncActionDescriptor(WalkThroughArrowUpAction, WalkThroughArrowUpAction.ID, WalkThroughArrowUpAction.LABEL, { primary: KeyCode.UpArrow }, ContextKeyExpr.and(WALK_THROUGH_FOCUS, EditorContextKeys.TextFocus.toNegated())), 'Interactive Playground: Scroll Up (Line)', localize('interactivePlayground', "Interactive Playground"));
.registerWorkbenchAction(new SyncActionDescriptor(WalkThroughArrowUpAction, WalkThroughArrowUpAction.ID, WalkThroughArrowUpAction.LABEL, { primary: KeyCode.UpArrow }, ContextKeyExpr.and(WALK_THROUGH_FOCUS, EditorContextKeys.textFocus.toNegated())), 'Interactive Playground: Scroll Up (Line)', localize('interactivePlayground', "Interactive Playground"));
Registry.as<IWorkbenchActionRegistry>(Extensions.WorkbenchActions)
.registerWorkbenchAction(new SyncActionDescriptor(WalkThroughArrowDownAction, WalkThroughArrowDownAction.ID, WalkThroughArrowDownAction.LABEL, { primary: KeyCode.DownArrow }, ContextKeyExpr.and(WALK_THROUGH_FOCUS, EditorContextKeys.TextFocus.toNegated())), 'Interactive Playground: Scroll Down (Line)', localize('interactivePlayground', "Interactive Playground"));
.registerWorkbenchAction(new SyncActionDescriptor(WalkThroughArrowDownAction, WalkThroughArrowDownAction.ID, WalkThroughArrowDownAction.LABEL, { primary: KeyCode.DownArrow }, ContextKeyExpr.and(WALK_THROUGH_FOCUS, EditorContextKeys.textFocus.toNegated())), 'Interactive Playground: Scroll Down (Line)', localize('interactivePlayground', "Interactive Playground"));
Registry.as<IWorkbenchActionRegistry>(Extensions.WorkbenchActions)
.registerWorkbenchAction(new SyncActionDescriptor(WalkThroughPageUpAction, WalkThroughPageUpAction.ID, WalkThroughPageUpAction.LABEL, { primary: KeyCode.PageUp }, ContextKeyExpr.and(WALK_THROUGH_FOCUS, EditorContextKeys.TextFocus.toNegated())), 'Interactive Playground: Scroll Up (Page)', localize('interactivePlayground', "Interactive Playground"));
.registerWorkbenchAction(new SyncActionDescriptor(WalkThroughPageUpAction, WalkThroughPageUpAction.ID, WalkThroughPageUpAction.LABEL, { primary: KeyCode.PageUp }, ContextKeyExpr.and(WALK_THROUGH_FOCUS, EditorContextKeys.textFocus.toNegated())), 'Interactive Playground: Scroll Up (Page)', localize('interactivePlayground', "Interactive Playground"));
Registry.as<IWorkbenchActionRegistry>(Extensions.WorkbenchActions)
.registerWorkbenchAction(new SyncActionDescriptor(WalkThroughPageDownAction, WalkThroughPageDownAction.ID, WalkThroughPageDownAction.LABEL, { primary: KeyCode.PageDown }, ContextKeyExpr.and(WALK_THROUGH_FOCUS, EditorContextKeys.TextFocus.toNegated())), 'Interactive Playground: Scroll Down (Page)', localize('interactivePlayground', "Interactive Playground"));
.registerWorkbenchAction(new SyncActionDescriptor(WalkThroughPageDownAction, WalkThroughPageDownAction.ID, WalkThroughPageDownAction.LABEL, { primary: KeyCode.PageDown }, ContextKeyExpr.and(WALK_THROUGH_FOCUS, EditorContextKeys.textFocus.toNegated())), 'Interactive Playground: Scroll Down (Page)', localize('interactivePlayground', "Interactive Playground"));
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册