提交 608c07c4 编写于 作者: A Alex Dima

Have kbOpts.weight be mandatory

上级 2b0800a5
......@@ -1620,7 +1620,7 @@ function findFocusedEditor(accessor: ServicesAccessor): ICodeEditor {
}
function registerCommand(command: Command) {
command.register(CORE_WEIGHT);
command.register();
}
/**
......
......@@ -29,7 +29,7 @@ export type IEditorContributionCtor = IConstructorSignature1<ICodeEditor, editor
export interface ICommandKeybindingsOptions extends IKeybindings {
kbExpr?: ContextKeyExpr;
weight?: number;
weight: number;
}
// export interface ICommandMenubarOptions {
// group?: string;
......@@ -57,36 +57,47 @@ export abstract class Command {
this._description = opts.description;
}
private _toCommandAndKeybindingRule(defaultWeight: number): ICommandAndKeybindingRule {
const kbOpts = this._kbOpts || { primary: 0 };
let kbWhen = kbOpts.kbExpr;
if (this.precondition) {
if (kbWhen) {
kbWhen = ContextKeyExpr.and(kbWhen, this.precondition);
} else {
kbWhen = this.precondition;
private _toCommandAndKeybindingRule(): ICommandAndKeybindingRule {
if (this._kbOpts) {
let kbWhen = this._kbOpts.kbExpr;
if (this.precondition) {
if (kbWhen) {
kbWhen = ContextKeyExpr.and(kbWhen, this.precondition);
} else {
kbWhen = this.precondition;
}
}
}
const weight = (typeof kbOpts.weight === 'number' ? kbOpts.weight : defaultWeight);
return {
id: this.id,
handler: (accessor, args) => this.runCommand(accessor, args),
weight: this._kbOpts.weight,
when: kbWhen,
primary: this._kbOpts.primary,
secondary: this._kbOpts.secondary,
win: this._kbOpts.win,
linux: this._kbOpts.linux,
mac: this._kbOpts.mac,
description: this._description
};
}
return {
id: this.id,
handler: (accessor, args) => this.runCommand(accessor, args),
weight: weight,
when: kbWhen,
primary: kbOpts.primary,
secondary: kbOpts.secondary,
win: kbOpts.win,
linux: kbOpts.linux,
mac: kbOpts.mac,
weight: undefined,
when: undefined,
primary: 0,
secondary: undefined,
win: undefined,
linux: undefined,
mac: undefined,
description: this._description
};
}
public register(defaultWeight: number): void {
KeybindingsRegistry.registerCommandAndKeybindingRule(this._toCommandAndKeybindingRule(defaultWeight));
public register(): void {
KeybindingsRegistry.registerCommandAndKeybindingRule(this._toCommandAndKeybindingRule());
}
public abstract runCommand(accessor: ServicesAccessor, args: any): void | TPromise<void>;
......@@ -193,14 +204,14 @@ export abstract class EditorAction extends EditorCommand {
};
}
public register(defaultWeight: number): void {
public register(): void {
let menuItem = this._toMenuItem();
if (menuItem) {
MenuRegistry.appendMenuItem(MenuId.EditorContext, menuItem);
}
super.register(defaultWeight);
super.register();
}
public runEditorCommand(accessor: ServicesAccessor, editor: ICodeEditor, args: any): void | TPromise<void> {
......@@ -316,7 +327,7 @@ class EditorContributionRegistry {
}
public registerEditorAction(action: EditorAction) {
action.register(KeybindingsRegistry.WEIGHT.editorContrib());
action.register();
this.editorActions.push(action);
}
......@@ -329,7 +340,7 @@ class EditorContributionRegistry {
}
public registerEditorCommand(editorCommand: EditorCommand) {
editorCommand.register(KeybindingsRegistry.WEIGHT.editorContrib());
editorCommand.register();
this.editorCommands[editorCommand.id] = editorCommand;
}
......
......@@ -30,6 +30,7 @@ import { ICodeEditorService } from 'vs/editor/browser/services/codeEditorService
import { ICodeEditor } from 'vs/editor/browser/editorBrowser';
import { ITextModel, TextModelResolvedOptions } from 'vs/editor/common/model';
import { ViewLineRenderingData } from 'vs/editor/common/viewModel/viewModel';
import { KeybindingsRegistry } from 'vs/platform/keybinding/common/keybindingsRegistry';
const DIFF_LINES_PADDING = 3;
......@@ -810,7 +811,8 @@ class DiffReviewNext extends EditorAction {
precondition: ContextKeyExpr.has('isInDiffEditor'),
kbOpts: {
kbExpr: null,
primary: KeyCode.F7
primary: KeyCode.F7,
weight: KeybindingsRegistry.WEIGHT.editorContrib()
}
});
}
......@@ -832,7 +834,8 @@ class DiffReviewPrev extends EditorAction {
precondition: ContextKeyExpr.has('isInDiffEditor'),
kbOpts: {
kbExpr: null,
primary: KeyMod.Shift | KeyCode.F7
primary: KeyMod.Shift | KeyCode.F7,
weight: KeybindingsRegistry.WEIGHT.editorContrib()
}
});
}
......
......@@ -22,6 +22,7 @@ import { ModelDecorationOptions } from 'vs/editor/common/model/textModel';
import { ICodeEditor } from 'vs/editor/browser/editorBrowser';
import { registerColor } from 'vs/platform/theme/common/colorRegistry';
import { TrackedRangeStickiness, IModelDeltaDecoration, OverviewRulerLane } from 'vs/editor/common/model';
import { KeybindingsRegistry } from 'vs/platform/keybinding/common/keybindingsRegistry';
const overviewRulerBracketMatchForeground = registerColor('editorOverviewRuler.bracketMatchForeground', { dark: '#A0A0A0', light: '#A0A0A0', hc: '#A0A0A0' }, nls.localize('overviewRulerBracketMatchForeground', 'Overview ruler marker color for matching brackets.'));
......@@ -34,7 +35,8 @@ class JumpToBracketAction extends EditorAction {
precondition: null,
kbOpts: {
kbExpr: EditorContextKeys.editorTextFocus,
primary: KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.US_BACKSLASH
primary: KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.US_BACKSLASH,
weight: KeybindingsRegistry.WEIGHT.editorContrib()
}
});
}
......
......@@ -15,6 +15,7 @@ import { registerEditorAction, EditorAction, ServicesAccessor } from 'vs/editor/
import { ReplaceCommand } from 'vs/editor/common/commands/replaceCommand';
import { ICodeEditor } from 'vs/editor/browser/editorBrowser';
import { ITextModel } from 'vs/editor/common/model';
import { KeybindingsRegistry } from 'vs/platform/keybinding/common/keybindingsRegistry';
class TransposeLettersAction extends EditorAction {
......@@ -67,7 +68,8 @@ class TransposeLettersAction extends EditorAction {
primary: 0,
mac: {
primary: KeyMod.WinCtrl | KeyCode.KEY_T
}
},
weight: KeybindingsRegistry.WEIGHT.editorContrib()
}
});
}
......
......@@ -16,6 +16,7 @@ import { registerEditorAction, IActionOptions, EditorAction, ICommandKeybindings
import { CopyOptions } from 'vs/editor/browser/controller/textAreaInput';
import { EditorContextKeys } from 'vs/editor/common/editorContextKeys';
import { ICodeEditor } from 'vs/editor/browser/editorBrowser';
import { KeybindingsRegistry } from 'vs/platform/keybinding/common/keybindingsRegistry';
const CLIPBOARD_CONTEXT_MENU_GROUP = '9_cutcopypaste';
......@@ -62,7 +63,8 @@ class ExecCommandCutAction extends ExecCommandAction {
let kbOpts: ICommandKeybindingsOptions = {
kbExpr: EditorContextKeys.textInputFocus,
primary: KeyMod.CtrlCmd | KeyCode.KEY_X,
win: { primary: KeyMod.CtrlCmd | KeyCode.KEY_X, secondary: [KeyMod.Shift | KeyCode.Delete] }
win: { primary: KeyMod.CtrlCmd | KeyCode.KEY_X, secondary: [KeyMod.Shift | KeyCode.Delete] },
weight: KeybindingsRegistry.WEIGHT.editorContrib()
};
// Do not bind cut keybindings in the browser,
// since browsers do that for us and it avoids security prompts
......@@ -99,7 +101,8 @@ class ExecCommandCopyAction extends ExecCommandAction {
let kbOpts: ICommandKeybindingsOptions = {
kbExpr: EditorContextKeys.textInputFocus,
primary: KeyMod.CtrlCmd | KeyCode.KEY_C,
win: { primary: KeyMod.CtrlCmd | KeyCode.KEY_C, secondary: [KeyMod.CtrlCmd | KeyCode.Insert] }
win: { primary: KeyMod.CtrlCmd | KeyCode.KEY_C, secondary: [KeyMod.CtrlCmd | KeyCode.Insert] },
weight: KeybindingsRegistry.WEIGHT.editorContrib()
};
// Do not bind copy keybindings in the browser,
// since browsers do that for us and it avoids security prompts
......@@ -137,7 +140,8 @@ class ExecCommandPasteAction extends ExecCommandAction {
let kbOpts: ICommandKeybindingsOptions = {
kbExpr: EditorContextKeys.textInputFocus,
primary: KeyMod.CtrlCmd | KeyCode.KEY_V,
win: { primary: KeyMod.CtrlCmd | KeyCode.KEY_V, secondary: [KeyMod.Shift | KeyCode.Insert] }
win: { primary: KeyMod.CtrlCmd | KeyCode.KEY_V, secondary: [KeyMod.Shift | KeyCode.Insert] },
weight: KeybindingsRegistry.WEIGHT.editorContrib()
};
// Do not bind paste keybindings in the browser,
// since browsers do that for us and it avoids security prompts
......@@ -169,7 +173,8 @@ class ExecCommandCopyWithSyntaxHighlightingAction extends ExecCommandAction {
precondition: null,
kbOpts: {
kbExpr: EditorContextKeys.textInputFocus,
primary: null
primary: null,
weight: KeybindingsRegistry.WEIGHT.editorContrib()
}
});
}
......
......@@ -26,6 +26,7 @@ import { CodeActionModel, CodeActionsComputeEvent, SUPPORTED_CODE_ACTIONS } from
import { CodeActionAutoApply, CodeActionFilter, CodeActionKind } from './codeActionTrigger';
import { CodeActionContextMenu } from './codeActionWidget';
import { LightBulbWidget } from './lightBulbWidget';
import { KeybindingsRegistry } from 'vs/platform/keybinding/common/keybindingsRegistry';
function contextKeyForSupportedActions(kind: CodeActionKind) {
return ContextKeyExpr.regex(
......@@ -192,7 +193,8 @@ export class QuickFixAction extends EditorAction {
precondition: ContextKeyExpr.and(EditorContextKeys.writable, EditorContextKeys.hasCodeActionsProvider),
kbOpts: {
kbExpr: EditorContextKeys.editorTextFocus,
primary: KeyMod.CtrlCmd | KeyCode.US_DOT
primary: KeyMod.CtrlCmd | KeyCode.US_DOT,
weight: KeybindingsRegistry.WEIGHT.editorContrib()
}
});
}
......@@ -272,7 +274,8 @@ export class RefactorAction extends EditorAction {
primary: KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.KEY_R,
mac: {
primary: KeyMod.WinCtrl | KeyMod.Shift | KeyCode.KEY_R
}
},
weight: KeybindingsRegistry.WEIGHT.editorContrib()
},
menuOpts: {
group: '1_modification',
......@@ -335,7 +338,8 @@ export class OrganizeImportsAction extends EditorAction {
contextKeyForSupportedActions(CodeActionKind.SourceOrganizeImports)),
kbOpts: {
kbExpr: EditorContextKeys.editorTextFocus,
primary: KeyMod.Shift | KeyMod.Alt | KeyCode.KEY_O
primary: KeyMod.Shift | KeyMod.Alt | KeyCode.KEY_O,
weight: KeybindingsRegistry.WEIGHT.editorContrib()
}
});
}
......
......@@ -12,6 +12,7 @@ import { registerEditorAction, IActionOptions, EditorAction, ServicesAccessor }
import { BlockCommentCommand } from './blockCommentCommand';
import { LineCommentCommand, Type } from './lineCommentCommand';
import { ICodeEditor } from 'vs/editor/browser/editorBrowser';
import { KeybindingsRegistry } from 'vs/platform/keybinding/common/keybindingsRegistry';
abstract class CommentLineAction extends EditorAction {
......@@ -52,7 +53,8 @@ class ToggleCommentLineAction extends CommentLineAction {
precondition: EditorContextKeys.writable,
kbOpts: {
kbExpr: EditorContextKeys.editorTextFocus,
primary: KeyMod.CtrlCmd | KeyCode.US_SLASH
primary: KeyMod.CtrlCmd | KeyCode.US_SLASH,
weight: KeybindingsRegistry.WEIGHT.editorContrib()
}
});
}
......@@ -67,7 +69,8 @@ class AddLineCommentAction extends CommentLineAction {
precondition: EditorContextKeys.writable,
kbOpts: {
kbExpr: EditorContextKeys.editorTextFocus,
primary: KeyChord(KeyMod.CtrlCmd | KeyCode.KEY_K, KeyMod.CtrlCmd | KeyCode.KEY_C)
primary: KeyChord(KeyMod.CtrlCmd | KeyCode.KEY_K, KeyMod.CtrlCmd | KeyCode.KEY_C),
weight: KeybindingsRegistry.WEIGHT.editorContrib()
}
});
}
......@@ -82,7 +85,8 @@ class RemoveLineCommentAction extends CommentLineAction {
precondition: EditorContextKeys.writable,
kbOpts: {
kbExpr: EditorContextKeys.editorTextFocus,
primary: KeyChord(KeyMod.CtrlCmd | KeyCode.KEY_K, KeyMod.CtrlCmd | KeyCode.KEY_U)
primary: KeyChord(KeyMod.CtrlCmd | KeyCode.KEY_K, KeyMod.CtrlCmd | KeyCode.KEY_U),
weight: KeybindingsRegistry.WEIGHT.editorContrib()
}
});
}
......@@ -99,7 +103,8 @@ class BlockCommentAction extends EditorAction {
kbOpts: {
kbExpr: EditorContextKeys.editorTextFocus,
primary: KeyMod.Shift | KeyMod.Alt | KeyCode.KEY_A,
linux: { primary: KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.KEY_A }
linux: { primary: KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.KEY_A },
weight: KeybindingsRegistry.WEIGHT.editorContrib()
}
});
}
......
......@@ -20,6 +20,7 @@ import { IEditorContribution, IScrollEvent, ScrollType } from 'vs/editor/common/
import { EditorContextKeys } from 'vs/editor/common/editorContextKeys';
import { registerEditorAction, registerEditorContribution, ServicesAccessor, EditorAction } from 'vs/editor/browser/editorExtensions';
import { ICodeEditor, IEditorMouseEvent, MouseTargetType } from 'vs/editor/browser/editorBrowser';
import { KeybindingsRegistry } from 'vs/platform/keybinding/common/keybindingsRegistry';
export interface IPosition {
x: number;
......@@ -227,7 +228,8 @@ class ShowContextMenu extends EditorAction {
precondition: null,
kbOpts: {
kbExpr: EditorContextKeys.textInputFocus,
primary: KeyMod.Shift | KeyCode.F10
primary: KeyMod.Shift | KeyCode.F10,
weight: KeybindingsRegistry.WEIGHT.editorContrib()
}
});
}
......
......@@ -12,6 +12,7 @@ import { Disposable } from 'vs/base/common/lifecycle';
import { IEditorContribution, ScrollType } from 'vs/editor/common/editorCommon';
import { EditorContextKeys } from 'vs/editor/common/editorContextKeys';
import { ICodeEditor } from 'vs/editor/browser/editorBrowser';
import { KeybindingsRegistry } from 'vs/platform/keybinding/common/keybindingsRegistry';
class CursorState {
readonly selections: Selection[];
......@@ -118,7 +119,8 @@ export class CursorUndo extends EditorAction {
precondition: null,
kbOpts: {
kbExpr: EditorContextKeys.textInputFocus,
primary: KeyMod.CtrlCmd | KeyCode.KEY_U
primary: KeyMod.CtrlCmd | KeyCode.KEY_U,
weight: KeybindingsRegistry.WEIGHT.editorContrib()
}
});
}
......
......@@ -386,7 +386,8 @@ export class StartFindAction extends EditorAction {
precondition: null,
kbOpts: {
kbExpr: null,
primary: KeyMod.CtrlCmd | KeyCode.KEY_F
primary: KeyMod.CtrlCmd | KeyCode.KEY_F,
weight: KeybindingsRegistry.WEIGHT.editorContrib()
}
});
}
......@@ -418,7 +419,8 @@ export class StartFindWithSelectionAction extends EditorAction {
primary: null,
mac: {
primary: KeyMod.CtrlCmd | KeyCode.KEY_E,
}
},
weight: KeybindingsRegistry.WEIGHT.editorContrib()
}
});
}
......@@ -467,7 +469,8 @@ export class NextMatchFindAction extends MatchFindAction {
kbOpts: {
kbExpr: EditorContextKeys.focus,
primary: KeyCode.F3,
mac: { primary: KeyMod.CtrlCmd | KeyCode.KEY_G, secondary: [KeyCode.F3] }
mac: { primary: KeyMod.CtrlCmd | KeyCode.KEY_G, secondary: [KeyCode.F3] },
weight: KeybindingsRegistry.WEIGHT.editorContrib()
}
});
}
......@@ -488,7 +491,8 @@ export class PreviousMatchFindAction extends MatchFindAction {
kbOpts: {
kbExpr: EditorContextKeys.focus,
primary: KeyMod.Shift | KeyCode.F3,
mac: { primary: KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.KEY_G, secondary: [KeyMod.Shift | KeyCode.F3] }
mac: { primary: KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.KEY_G, secondary: [KeyMod.Shift | KeyCode.F3] },
weight: KeybindingsRegistry.WEIGHT.editorContrib()
}
});
}
......@@ -533,7 +537,8 @@ export class NextSelectionMatchFindAction extends SelectionMatchFindAction {
precondition: null,
kbOpts: {
kbExpr: EditorContextKeys.focus,
primary: KeyMod.CtrlCmd | KeyCode.F3
primary: KeyMod.CtrlCmd | KeyCode.F3,
weight: KeybindingsRegistry.WEIGHT.editorContrib()
}
});
}
......@@ -553,7 +558,8 @@ export class PreviousSelectionMatchFindAction extends SelectionMatchFindAction {
precondition: null,
kbOpts: {
kbExpr: EditorContextKeys.focus,
primary: KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.F3
primary: KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.F3,
weight: KeybindingsRegistry.WEIGHT.editorContrib()
}
});
}
......@@ -574,7 +580,8 @@ export class StartFindReplaceAction extends EditorAction {
kbOpts: {
kbExpr: null,
primary: KeyMod.CtrlCmd | KeyCode.KEY_H,
mac: { primary: KeyMod.CtrlCmd | KeyMod.Alt | KeyCode.KEY_F }
mac: { primary: KeyMod.CtrlCmd | KeyMod.Alt | KeyCode.KEY_F },
weight: KeybindingsRegistry.WEIGHT.editorContrib()
}
});
}
......
......@@ -32,6 +32,7 @@ import { FoldingRangeProviderRegistry, FoldingRangeKind } from 'vs/editor/common
import { SyntaxRangeProvider, ID_SYNTAX_PROVIDER } from './syntaxRangeProvider';
import { CancellationToken } from 'vs/base/common/cancellation';
import { InitializingRangeProvider, ID_INIT_PROVIDER } from 'vs/editor/contrib/folding/intializingRangeProvider';
import { KeybindingsRegistry } from 'vs/platform/keybinding/common/keybindingsRegistry';
export const ID = 'editor.contrib.folding';
......@@ -486,7 +487,8 @@ class UnfoldAction extends FoldingAction<FoldingArguments> {
primary: KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.US_CLOSE_SQUARE_BRACKET,
mac: {
primary: KeyMod.CtrlCmd | KeyMod.Alt | KeyCode.US_CLOSE_SQUARE_BRACKET
}
},
weight: KeybindingsRegistry.WEIGHT.editorContrib()
},
description: {
description: 'Unfold the content in the editor',
......@@ -526,7 +528,8 @@ class UnFoldRecursivelyAction extends FoldingAction<void> {
precondition: null,
kbOpts: {
kbExpr: EditorContextKeys.editorTextFocus,
primary: KeyChord(KeyMod.CtrlCmd | KeyCode.KEY_K, KeyMod.CtrlCmd | KeyCode.US_CLOSE_SQUARE_BRACKET)
primary: KeyChord(KeyMod.CtrlCmd | KeyCode.KEY_K, KeyMod.CtrlCmd | KeyCode.US_CLOSE_SQUARE_BRACKET),
weight: KeybindingsRegistry.WEIGHT.editorContrib()
}
});
}
......@@ -549,7 +552,8 @@ class FoldAction extends FoldingAction<FoldingArguments> {
primary: KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.US_OPEN_SQUARE_BRACKET,
mac: {
primary: KeyMod.CtrlCmd | KeyMod.Alt | KeyCode.US_OPEN_SQUARE_BRACKET
}
},
weight: KeybindingsRegistry.WEIGHT.editorContrib()
},
description: {
description: 'Fold the content in the editor',
......@@ -589,7 +593,8 @@ class FoldRecursivelyAction extends FoldingAction<void> {
precondition: null,
kbOpts: {
kbExpr: EditorContextKeys.editorTextFocus,
primary: KeyChord(KeyMod.CtrlCmd | KeyCode.KEY_K, KeyMod.CtrlCmd | KeyCode.US_OPEN_SQUARE_BRACKET)
primary: KeyChord(KeyMod.CtrlCmd | KeyCode.KEY_K, KeyMod.CtrlCmd | KeyCode.US_OPEN_SQUARE_BRACKET),
weight: KeybindingsRegistry.WEIGHT.editorContrib()
}
});
}
......@@ -610,7 +615,8 @@ class FoldAllBlockCommentsAction extends FoldingAction<void> {
precondition: null,
kbOpts: {
kbExpr: EditorContextKeys.editorTextFocus,
primary: KeyChord(KeyMod.CtrlCmd | KeyCode.KEY_K, KeyMod.CtrlCmd | KeyCode.US_SLASH)
primary: KeyChord(KeyMod.CtrlCmd | KeyCode.KEY_K, KeyMod.CtrlCmd | KeyCode.US_SLASH),
weight: KeybindingsRegistry.WEIGHT.editorContrib()
}
});
}
......@@ -638,7 +644,8 @@ class FoldAllRegionsAction extends FoldingAction<void> {
precondition: null,
kbOpts: {
kbExpr: EditorContextKeys.editorTextFocus,
primary: KeyChord(KeyMod.CtrlCmd | KeyCode.KEY_K, KeyMod.CtrlCmd | KeyCode.KEY_8)
primary: KeyChord(KeyMod.CtrlCmd | KeyCode.KEY_K, KeyMod.CtrlCmd | KeyCode.KEY_8),
weight: KeybindingsRegistry.WEIGHT.editorContrib()
}
});
}
......@@ -666,7 +673,8 @@ class UnfoldAllRegionsAction extends FoldingAction<void> {
precondition: null,
kbOpts: {
kbExpr: EditorContextKeys.editorTextFocus,
primary: KeyChord(KeyMod.CtrlCmd | KeyCode.KEY_K, KeyMod.CtrlCmd | KeyCode.KEY_9)
primary: KeyChord(KeyMod.CtrlCmd | KeyCode.KEY_K, KeyMod.CtrlCmd | KeyCode.KEY_9),
weight: KeybindingsRegistry.WEIGHT.editorContrib()
}
});
}
......@@ -694,7 +702,8 @@ class FoldAllAction extends FoldingAction<void> {
precondition: null,
kbOpts: {
kbExpr: EditorContextKeys.editorTextFocus,
primary: KeyChord(KeyMod.CtrlCmd | KeyCode.KEY_K, KeyMod.CtrlCmd | KeyCode.KEY_0)
primary: KeyChord(KeyMod.CtrlCmd | KeyCode.KEY_K, KeyMod.CtrlCmd | KeyCode.KEY_0),
weight: KeybindingsRegistry.WEIGHT.editorContrib()
}
});
}
......@@ -714,7 +723,8 @@ class UnfoldAllAction extends FoldingAction<void> {
precondition: null,
kbOpts: {
kbExpr: EditorContextKeys.editorTextFocus,
primary: KeyChord(KeyMod.CtrlCmd | KeyCode.KEY_K, KeyMod.CtrlCmd | KeyCode.KEY_J)
primary: KeyChord(KeyMod.CtrlCmd | KeyCode.KEY_K, KeyMod.CtrlCmd | KeyCode.KEY_J),
weight: KeybindingsRegistry.WEIGHT.editorContrib()
}
});
}
......@@ -757,7 +767,8 @@ for (let i = 1; i <= 7; i++) {
precondition: null,
kbOpts: {
kbExpr: EditorContextKeys.editorTextFocus,
primary: KeyChord(KeyMod.CtrlCmd | KeyCode.KEY_K, KeyMod.CtrlCmd | (KeyCode.KEY_0 + i))
primary: KeyChord(KeyMod.CtrlCmd | KeyCode.KEY_K, KeyMod.CtrlCmd | (KeyCode.KEY_0 + i)),
weight: KeybindingsRegistry.WEIGHT.editorContrib()
}
})
);
......
......@@ -26,6 +26,7 @@ import { EditorContextKeys } from 'vs/editor/common/editorContextKeys';
import { ICodeEditor } from 'vs/editor/browser/editorBrowser';
import { ISingleEditOperation } from 'vs/editor/common/model';
import { INotificationService } from 'vs/platform/notification/common/notification';
import { KeybindingsRegistry } from 'vs/platform/keybinding/common/keybindingsRegistry';
function alertFormattingEdits(edits: ISingleEditOperation[]): void {
......@@ -310,7 +311,8 @@ export class FormatDocumentAction extends AbstractFormatAction {
kbExpr: EditorContextKeys.editorTextFocus,
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 }
linux: { primary: KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.KEY_I },
weight: KeybindingsRegistry.WEIGHT.editorContrib()
},
menuOpts: {
when: EditorContextKeys.hasDocumentFormattingProvider,
......@@ -341,7 +343,8 @@ export class FormatSelectionAction extends AbstractFormatAction {
precondition: ContextKeyExpr.and(EditorContextKeys.writable, EditorContextKeys.hasNonEmptySelection),
kbOpts: {
kbExpr: EditorContextKeys.editorTextFocus,
primary: KeyChord(KeyMod.CtrlCmd | KeyCode.KEY_K, KeyMod.CtrlCmd | KeyCode.KEY_F)
primary: KeyChord(KeyMod.CtrlCmd | KeyCode.KEY_K, KeyMod.CtrlCmd | KeyCode.KEY_F),
weight: KeybindingsRegistry.WEIGHT.editorContrib()
},
menuOpts: {
when: ContextKeyExpr.and(EditorContextKeys.hasDocumentSelectionFormattingProvider, EditorContextKeys.hasNonEmptySelection),
......
......@@ -25,6 +25,7 @@ import { ICodeEditor } from 'vs/editor/browser/editorBrowser';
import { ITextModel, IWordAtPosition } from 'vs/editor/common/model';
import { INotificationService } from 'vs/platform/notification/common/notification';
import { createCancelablePromise } from 'vs/base/common/async';
import { KeybindingsRegistry } from 'vs/platform/keybinding/common/keybindingsRegistry';
export class DefinitionActionConfig {
......@@ -191,7 +192,8 @@ export class GoToDefinitionAction extends DefinitionAction {
EditorContextKeys.isInEmbeddedEditor.toNegated()),
kbOpts: {
kbExpr: EditorContextKeys.editorTextFocus,
primary: goToDeclarationKb
primary: goToDeclarationKb,
weight: KeybindingsRegistry.WEIGHT.editorContrib()
},
menuOpts: {
group: 'navigation',
......@@ -215,7 +217,8 @@ export class OpenDefinitionToSideAction extends DefinitionAction {
EditorContextKeys.isInEmbeddedEditor.toNegated()),
kbOpts: {
kbExpr: EditorContextKeys.editorTextFocus,
primary: KeyChord(KeyMod.CtrlCmd | KeyCode.KEY_K, goToDeclarationKb)
primary: KeyChord(KeyMod.CtrlCmd | KeyCode.KEY_K, goToDeclarationKb),
weight: KeybindingsRegistry.WEIGHT.editorContrib()
}
});
}
......@@ -234,7 +237,8 @@ export class PeekDefinitionAction extends DefinitionAction {
kbOpts: {
kbExpr: EditorContextKeys.editorTextFocus,
primary: KeyMod.Alt | KeyCode.F12,
linux: { primary: KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.F10 }
linux: { primary: KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.F10 },
weight: KeybindingsRegistry.WEIGHT.editorContrib()
},
menuOpts: {
group: 'navigation',
......@@ -274,7 +278,8 @@ export class GoToImplementationAction extends ImplementationAction {
EditorContextKeys.isInEmbeddedEditor.toNegated()),
kbOpts: {
kbExpr: EditorContextKeys.editorTextFocus,
primary: KeyMod.CtrlCmd | KeyCode.F12
primary: KeyMod.CtrlCmd | KeyCode.F12,
weight: KeybindingsRegistry.WEIGHT.editorContrib()
}
});
}
......@@ -294,7 +299,8 @@ export class PeekImplementationAction extends ImplementationAction {
EditorContextKeys.isInEmbeddedEditor.toNegated()),
kbOpts: {
kbExpr: EditorContextKeys.editorTextFocus,
primary: KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.F12
primary: KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.F12,
weight: KeybindingsRegistry.WEIGHT.editorContrib()
}
});
}
......@@ -330,7 +336,8 @@ export class GoToTypeDefinitionAction extends TypeDefinitionAction {
EditorContextKeys.isInEmbeddedEditor.toNegated()),
kbOpts: {
kbExpr: EditorContextKeys.editorTextFocus,
primary: 0
primary: 0,
weight: KeybindingsRegistry.WEIGHT.editorContrib()
},
menuOpts: {
group: 'navigation',
......@@ -354,7 +361,8 @@ export class PeekTypeDefinitionAction extends TypeDefinitionAction {
EditorContextKeys.isInEmbeddedEditor.toNegated()),
kbOpts: {
kbExpr: EditorContextKeys.editorTextFocus,
primary: 0
primary: 0,
weight: KeybindingsRegistry.WEIGHT.editorContrib()
}
});
}
......
......@@ -401,7 +401,8 @@ class NextMarkerInFilesAction extends MarkerNavigationAction {
precondition: EditorContextKeys.writable,
kbOpts: {
kbExpr: EditorContextKeys.focus,
primary: KeyCode.F8
primary: KeyCode.F8,
weight: KeybindingsRegistry.WEIGHT.editorContrib()
}
});
}
......@@ -416,7 +417,8 @@ class PrevMarkerInFilesAction extends MarkerNavigationAction {
precondition: EditorContextKeys.writable,
kbOpts: {
kbExpr: EditorContextKeys.focus,
primary: KeyMod.Shift | KeyCode.F8
primary: KeyMod.Shift | KeyCode.F8,
weight: KeybindingsRegistry.WEIGHT.editorContrib()
}
});
}
......
......@@ -26,6 +26,7 @@ import { EditorContextKeys } from 'vs/editor/common/editorContextKeys';
import { MarkdownRenderer } from 'vs/editor/contrib/markdown/markdownRenderer';
import { IEmptyContentData } from 'vs/editor/browser/controller/mouseTarget';
import { HoverStartMode } from 'vs/editor/contrib/hover/hoverOperation';
import { KeybindingsRegistry } from 'vs/platform/keybinding/common/keybindingsRegistry';
export class ModesHoverController implements IEditorContribution {
......@@ -250,7 +251,8 @@ class ShowHoverAction extends EditorAction {
precondition: null,
kbOpts: {
kbExpr: EditorContextKeys.editorTextFocus,
primary: KeyChord(KeyMod.CtrlCmd | KeyCode.KEY_K, KeyMod.CtrlCmd | KeyCode.KEY_I)
primary: KeyChord(KeyMod.CtrlCmd | KeyCode.KEY_K, KeyMod.CtrlCmd | KeyCode.KEY_I),
weight: KeybindingsRegistry.WEIGHT.editorContrib()
}
});
}
......
......@@ -22,6 +22,7 @@ import { ModelDecorationOptions } from 'vs/editor/common/model/textModel';
import { ICodeEditor } from 'vs/editor/browser/editorBrowser';
import { CancelablePromise, createCancelablePromise, timeout } from 'vs/base/common/async';
import { onUnexpectedError } from 'vs/base/common/errors';
import { KeybindingsRegistry } from 'vs/platform/keybinding/common/keybindingsRegistry';
class InPlaceReplaceController implements IEditorContribution {
......@@ -142,7 +143,8 @@ class InPlaceReplaceUp extends EditorAction {
precondition: EditorContextKeys.writable,
kbOpts: {
kbExpr: EditorContextKeys.editorTextFocus,
primary: KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.US_COMMA
primary: KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.US_COMMA,
weight: KeybindingsRegistry.WEIGHT.editorContrib()
}
});
}
......@@ -166,7 +168,8 @@ class InPlaceReplaceDown extends EditorAction {
precondition: EditorContextKeys.writable,
kbOpts: {
kbExpr: EditorContextKeys.editorTextFocus,
primary: KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.US_DOT
primary: KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.US_DOT,
weight: KeybindingsRegistry.WEIGHT.editorContrib()
}
});
}
......
......@@ -23,6 +23,7 @@ import { MoveLinesCommand } from './moveLinesCommand';
import { TypeOperations } from 'vs/editor/common/controller/cursorTypeOperations';
import { CoreEditingCommands } from 'vs/editor/browser/controller/coreCommands';
import { ICodeEditor } from 'vs/editor/browser/editorBrowser';
import { KeybindingsRegistry } from 'vs/platform/keybinding/common/keybindingsRegistry';
// copy lines
......@@ -60,7 +61,8 @@ class CopyLinesUpAction extends AbstractCopyLinesAction {
kbOpts: {
kbExpr: EditorContextKeys.editorTextFocus,
primary: KeyMod.Alt | KeyMod.Shift | KeyCode.UpArrow,
linux: { primary: KeyMod.CtrlCmd | KeyMod.Alt | KeyMod.Shift | KeyCode.UpArrow }
linux: { primary: KeyMod.CtrlCmd | KeyMod.Alt | KeyMod.Shift | KeyCode.UpArrow },
weight: KeybindingsRegistry.WEIGHT.editorContrib()
}
});
}
......@@ -76,7 +78,8 @@ class CopyLinesDownAction extends AbstractCopyLinesAction {
kbOpts: {
kbExpr: EditorContextKeys.editorTextFocus,
primary: KeyMod.Alt | KeyMod.Shift | KeyCode.DownArrow,
linux: { primary: KeyMod.CtrlCmd | KeyMod.Alt | KeyMod.Shift | KeyCode.DownArrow }
linux: { primary: KeyMod.CtrlCmd | KeyMod.Alt | KeyMod.Shift | KeyCode.DownArrow },
weight: KeybindingsRegistry.WEIGHT.editorContrib()
}
});
}
......@@ -119,7 +122,8 @@ class MoveLinesUpAction extends AbstractMoveLinesAction {
kbOpts: {
kbExpr: EditorContextKeys.editorTextFocus,
primary: KeyMod.Alt | KeyCode.UpArrow,
linux: { primary: KeyMod.Alt | KeyCode.UpArrow }
linux: { primary: KeyMod.Alt | KeyCode.UpArrow },
weight: KeybindingsRegistry.WEIGHT.editorContrib()
}
});
}
......@@ -135,7 +139,8 @@ class MoveLinesDownAction extends AbstractMoveLinesAction {
kbOpts: {
kbExpr: EditorContextKeys.editorTextFocus,
primary: KeyMod.Alt | KeyCode.DownArrow,
linux: { primary: KeyMod.Alt | KeyCode.DownArrow }
linux: { primary: KeyMod.Alt | KeyCode.DownArrow },
weight: KeybindingsRegistry.WEIGHT.editorContrib()
}
});
}
......@@ -204,7 +209,8 @@ export class TrimTrailingWhitespaceAction extends EditorAction {
precondition: EditorContextKeys.writable,
kbOpts: {
kbExpr: EditorContextKeys.editorTextFocus,
primary: KeyChord(KeyMod.CtrlCmd | KeyCode.KEY_K, KeyMod.CtrlCmd | KeyCode.KEY_X)
primary: KeyChord(KeyMod.CtrlCmd | KeyCode.KEY_K, KeyMod.CtrlCmd | KeyCode.KEY_X),
weight: KeybindingsRegistry.WEIGHT.editorContrib()
}
});
}
......@@ -245,7 +251,8 @@ class DeleteLinesAction extends EditorAction {
precondition: EditorContextKeys.writable,
kbOpts: {
kbExpr: EditorContextKeys.textInputFocus,
primary: KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.KEY_K
primary: KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.KEY_K,
weight: KeybindingsRegistry.WEIGHT.editorContrib()
}
});
}
......@@ -314,7 +321,8 @@ export class IndentLinesAction extends EditorAction {
precondition: EditorContextKeys.writable,
kbOpts: {
kbExpr: EditorContextKeys.editorTextFocus,
primary: KeyMod.CtrlCmd | KeyCode.US_CLOSE_SQUARE_BRACKET
primary: KeyMod.CtrlCmd | KeyCode.US_CLOSE_SQUARE_BRACKET,
weight: KeybindingsRegistry.WEIGHT.editorContrib()
}
});
}
......@@ -335,7 +343,8 @@ class OutdentLinesAction extends EditorAction {
precondition: EditorContextKeys.writable,
kbOpts: {
kbExpr: EditorContextKeys.editorTextFocus,
primary: KeyMod.CtrlCmd | KeyCode.US_OPEN_SQUARE_BRACKET
primary: KeyMod.CtrlCmd | KeyCode.US_OPEN_SQUARE_BRACKET,
weight: KeybindingsRegistry.WEIGHT.editorContrib()
}
});
}
......@@ -354,7 +363,8 @@ export class InsertLineBeforeAction extends EditorAction {
precondition: EditorContextKeys.writable,
kbOpts: {
kbExpr: EditorContextKeys.editorTextFocus,
primary: KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.Enter
primary: KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.Enter,
weight: KeybindingsRegistry.WEIGHT.editorContrib()
}
});
}
......@@ -374,7 +384,8 @@ export class InsertLineAfterAction extends EditorAction {
precondition: EditorContextKeys.writable,
kbOpts: {
kbExpr: EditorContextKeys.editorTextFocus,
primary: KeyMod.CtrlCmd | KeyCode.Enter
primary: KeyMod.CtrlCmd | KeyCode.Enter,
weight: KeybindingsRegistry.WEIGHT.editorContrib()
}
});
}
......@@ -434,7 +445,8 @@ export class DeleteAllLeftAction extends AbstractDeleteAllToBoundaryAction {
kbOpts: {
kbExpr: EditorContextKeys.textInputFocus,
primary: null,
mac: { primary: KeyMod.CtrlCmd | KeyCode.Backspace }
mac: { primary: KeyMod.CtrlCmd | KeyCode.Backspace },
weight: KeybindingsRegistry.WEIGHT.editorContrib()
}
});
}
......@@ -502,7 +514,8 @@ export class DeleteAllRightAction extends AbstractDeleteAllToBoundaryAction {
kbOpts: {
kbExpr: EditorContextKeys.textInputFocus,
primary: null,
mac: { primary: KeyMod.WinCtrl | KeyCode.KEY_K, secondary: [KeyMod.CtrlCmd | KeyCode.Delete] }
mac: { primary: KeyMod.WinCtrl | KeyCode.KEY_K, secondary: [KeyMod.CtrlCmd | KeyCode.Delete] },
weight: KeybindingsRegistry.WEIGHT.editorContrib()
}
});
}
......@@ -559,7 +572,8 @@ export class JoinLinesAction extends EditorAction {
kbOpts: {
kbExpr: EditorContextKeys.editorTextFocus,
primary: 0,
mac: { primary: KeyMod.WinCtrl | KeyCode.KEY_J }
mac: { primary: KeyMod.WinCtrl | KeyCode.KEY_J },
weight: KeybindingsRegistry.WEIGHT.editorContrib()
}
});
}
......
......@@ -25,6 +25,7 @@ import { overviewRulerSelectionHighlightForeground } from 'vs/platform/theme/com
import { themeColorFromId } from 'vs/platform/theme/common/themeService';
import { INewFindReplaceState, FindOptionOverride } from 'vs/editor/contrib/find/findState';
import { ICodeEditor } from 'vs/editor/browser/editorBrowser';
import { KeybindingsRegistry } from 'vs/platform/keybinding/common/keybindingsRegistry';
export class InsertCursorAbove extends EditorAction {
......@@ -40,7 +41,8 @@ export class InsertCursorAbove extends EditorAction {
linux: {
primary: KeyMod.Shift | KeyMod.Alt | KeyCode.UpArrow,
secondary: [KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.UpArrow]
}
},
weight: KeybindingsRegistry.WEIGHT.editorContrib()
}
});
}
......@@ -78,7 +80,8 @@ export class InsertCursorBelow extends EditorAction {
linux: {
primary: KeyMod.Shift | KeyMod.Alt | KeyCode.DownArrow,
secondary: [KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.DownArrow]
}
},
weight: KeybindingsRegistry.WEIGHT.editorContrib()
}
});
}
......@@ -112,7 +115,8 @@ class InsertCursorAtEndOfEachLineSelected extends EditorAction {
precondition: null,
kbOpts: {
kbExpr: EditorContextKeys.editorTextFocus,
primary: KeyMod.Shift | KeyMod.Alt | KeyCode.KEY_I
primary: KeyMod.Shift | KeyMod.Alt | KeyCode.KEY_I,
weight: KeybindingsRegistry.WEIGHT.editorContrib()
}
});
}
......@@ -522,7 +526,8 @@ export class AddSelectionToNextFindMatchAction extends MultiCursorSelectionContr
precondition: null,
kbOpts: {
kbExpr: EditorContextKeys.focus,
primary: KeyMod.CtrlCmd | KeyCode.KEY_D
primary: KeyMod.CtrlCmd | KeyCode.KEY_D,
weight: KeybindingsRegistry.WEIGHT.editorContrib()
}
});
}
......@@ -554,7 +559,8 @@ export class MoveSelectionToNextFindMatchAction extends MultiCursorSelectionCont
precondition: null,
kbOpts: {
kbExpr: EditorContextKeys.focus,
primary: KeyChord(KeyMod.CtrlCmd | KeyCode.KEY_K, KeyMod.CtrlCmd | KeyCode.KEY_D)
primary: KeyChord(KeyMod.CtrlCmd | KeyCode.KEY_K, KeyMod.CtrlCmd | KeyCode.KEY_D),
weight: KeybindingsRegistry.WEIGHT.editorContrib()
}
});
}
......@@ -586,7 +592,8 @@ export class SelectHighlightsAction extends MultiCursorSelectionControllerAction
precondition: null,
kbOpts: {
kbExpr: EditorContextKeys.focus,
primary: KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.KEY_L
primary: KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.KEY_L,
weight: KeybindingsRegistry.WEIGHT.editorContrib()
}
});
}
......@@ -604,7 +611,8 @@ export class CompatChangeAll extends MultiCursorSelectionControllerAction {
precondition: EditorContextKeys.writable,
kbOpts: {
kbExpr: EditorContextKeys.editorTextFocus,
primary: KeyMod.CtrlCmd | KeyCode.F2
primary: KeyMod.CtrlCmd | KeyCode.F2,
weight: KeybindingsRegistry.WEIGHT.editorContrib()
},
menuOpts: {
group: '1_modification',
......
......@@ -68,7 +68,8 @@ export class TriggerParameterHintsAction extends EditorAction {
precondition: EditorContextKeys.hasSignatureHelpProvider,
kbOpts: {
kbExpr: EditorContextKeys.editorTextFocus,
primary: KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.Space
primary: KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.Space,
weight: KeybindingsRegistry.WEIGHT.editorContrib()
}
});
}
......
......@@ -70,7 +70,8 @@ export class ReferenceAction extends EditorAction {
EditorContextKeys.isInEmbeddedEditor.toNegated()),
kbOpts: {
kbExpr: EditorContextKeys.editorTextFocus,
primary: KeyMod.Shift | KeyCode.F12
primary: KeyMod.Shift | KeyCode.F12,
weight: KeybindingsRegistry.WEIGHT.editorContrib()
},
menuOpts: {
group: 'navigation',
......
......@@ -224,7 +224,8 @@ export class RenameAction extends EditorAction {
precondition: ContextKeyExpr.and(EditorContextKeys.writable, EditorContextKeys.hasRenameProvider),
kbOpts: {
kbExpr: EditorContextKeys.editorTextFocus,
primary: KeyCode.F2
primary: KeyCode.F2,
weight: KeybindingsRegistry.WEIGHT.editorContrib()
},
menuOpts: {
group: '1_modification',
......
......@@ -16,6 +16,7 @@ import { registerEditorAction, ServicesAccessor, IActionOptions, EditorAction, r
import { TokenSelectionSupport, ILogicalSelectionEntry } from './tokenSelectionSupport';
import { ICursorPositionChangedEvent } from 'vs/editor/common/controller/cursorEvents';
import { ICodeEditor } from 'vs/editor/browser/editorBrowser';
import { KeybindingsRegistry } from 'vs/platform/keybinding/common/keybindingsRegistry';
// --- selection state machine
......@@ -173,7 +174,8 @@ class GrowSelectionAction extends AbstractSmartSelect {
kbOpts: {
kbExpr: EditorContextKeys.editorTextFocus,
primary: KeyMod.Shift | KeyMod.Alt | KeyCode.RightArrow,
mac: { primary: KeyMod.CtrlCmd | KeyMod.WinCtrl | KeyMod.Shift | KeyCode.RightArrow }
mac: { primary: KeyMod.CtrlCmd | KeyMod.WinCtrl | KeyMod.Shift | KeyCode.RightArrow },
weight: KeybindingsRegistry.WEIGHT.editorContrib()
}
});
}
......@@ -189,7 +191,8 @@ class ShrinkSelectionAction extends AbstractSmartSelect {
kbOpts: {
kbExpr: EditorContextKeys.editorTextFocus,
primary: KeyMod.Shift | KeyMod.Alt | KeyCode.LeftArrow,
mac: { primary: KeyMod.CtrlCmd | KeyMod.WinCtrl | KeyMod.Shift | KeyCode.LeftArrow }
mac: { primary: KeyMod.CtrlCmd | KeyMod.WinCtrl | KeyMod.Shift | KeyCode.LeftArrow },
weight: KeybindingsRegistry.WEIGHT.editorContrib()
}
});
}
......
......@@ -325,7 +325,8 @@ export class TriggerSuggestAction extends EditorAction {
kbOpts: {
kbExpr: EditorContextKeys.textInputFocus,
primary: KeyMod.CtrlCmd | KeyCode.Space,
mac: { primary: KeyMod.WinCtrl | KeyCode.Space }
mac: { primary: KeyMod.WinCtrl | KeyCode.Space },
weight: KeybindingsRegistry.WEIGHT.editorContrib()
}
});
}
......
......@@ -9,6 +9,7 @@ import { KeyCode, KeyMod } from 'vs/base/common/keyCodes';
import { registerEditorAction, ServicesAccessor, EditorAction } from 'vs/editor/browser/editorExtensions';
import { TabFocus } from 'vs/editor/common/config/commonEditorConfig';
import { ICodeEditor } from 'vs/editor/browser/editorBrowser';
import { KeybindingsRegistry } from 'vs/platform/keybinding/common/keybindingsRegistry';
export class ToggleTabFocusModeAction extends EditorAction {
......@@ -23,7 +24,8 @@ export class ToggleTabFocusModeAction extends EditorAction {
kbOpts: {
kbExpr: null,
primary: KeyMod.CtrlCmd | KeyCode.KEY_M,
mac: { primary: KeyMod.WinCtrl | KeyMod.Shift | KeyCode.KEY_M }
mac: { primary: KeyMod.WinCtrl | KeyMod.Shift | KeyCode.KEY_M },
weight: KeybindingsRegistry.WEIGHT.editorContrib()
}
});
}
......
......@@ -25,6 +25,7 @@ import { firstIndex, isFalsyOrEmpty } from 'vs/base/common/arrays';
import { ICodeEditor } from 'vs/editor/browser/editorBrowser';
import { ITextModel, TrackedRangeStickiness, OverviewRulerLane, IModelDeltaDecoration } from 'vs/editor/common/model';
import { CancellationToken } from 'vs/base/common/cancellation';
import { KeybindingsRegistry } from 'vs/platform/keybinding/common/keybindingsRegistry';
export const editorWordHighlight = registerColor('editor.wordHighlightBackground', { dark: '#575757B8', light: '#57575740', hc: null }, nls.localize('wordHighlight', 'Background color of a symbol during read-access, like reading a variable. The color must not be opaque to not hide underlying decorations.'), true);
export const editorWordHighlightStrong = registerColor('editor.wordHighlightStrongBackground', { dark: '#004972B8', light: '#0e639c40', hc: null }, nls.localize('wordHighlightStrong', 'Background color of a symbol during write-access, like writing to a variable. The color must not be opaque to not hide underlying decorations.'), true);
......@@ -459,7 +460,8 @@ class NextWordHighlightAction extends WordHighlightNavigationAction {
precondition: ctxHasWordHighlights,
kbOpts: {
kbExpr: EditorContextKeys.editorTextFocus,
primary: KeyCode.F7
primary: KeyCode.F7,
weight: KeybindingsRegistry.WEIGHT.editorContrib()
}
});
}
......@@ -474,7 +476,8 @@ class PrevWordHighlightAction extends WordHighlightNavigationAction {
precondition: ctxHasWordHighlights,
kbOpts: {
kbExpr: EditorContextKeys.editorTextFocus,
primary: KeyMod.Shift | KeyCode.F7
primary: KeyMod.Shift | KeyCode.F7,
weight: KeybindingsRegistry.WEIGHT.editorContrib()
}
});
}
......
......@@ -19,6 +19,7 @@ import { getMapForWordSeparators, WordCharacterClassifier } from 'vs/editor/comm
import { CursorState } from 'vs/editor/common/controller/cursorCommon';
import { CursorChangeReason } from 'vs/editor/common/controller/cursorEvents';
import { ICodeEditor } from 'vs/editor/browser/editorBrowser';
import { KeybindingsRegistry } from 'vs/platform/keybinding/common/keybindingsRegistry';
export interface MoveWordOptions extends ICommandOptions {
inSelectionMode: boolean;
......@@ -100,7 +101,8 @@ export class CursorWordStartLeft extends WordLeftCommand {
kbOpts: {
kbExpr: EditorContextKeys.textInputFocus,
primary: KeyMod.CtrlCmd | KeyCode.LeftArrow,
mac: { primary: KeyMod.Alt | KeyCode.LeftArrow }
mac: { primary: KeyMod.Alt | KeyCode.LeftArrow },
weight: KeybindingsRegistry.WEIGHT.editorContrib()
}
});
}
......@@ -138,7 +140,8 @@ export class CursorWordStartLeftSelect extends WordLeftCommand {
kbOpts: {
kbExpr: EditorContextKeys.textInputFocus,
primary: KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.LeftArrow,
mac: { primary: KeyMod.Alt | KeyMod.Shift | KeyCode.LeftArrow }
mac: { primary: KeyMod.Alt | KeyMod.Shift | KeyCode.LeftArrow },
weight: KeybindingsRegistry.WEIGHT.editorContrib()
}
});
}
......@@ -187,7 +190,8 @@ export class CursorWordEndRight extends WordRightCommand {
kbOpts: {
kbExpr: EditorContextKeys.textInputFocus,
primary: KeyMod.CtrlCmd | KeyCode.RightArrow,
mac: { primary: KeyMod.Alt | KeyCode.RightArrow }
mac: { primary: KeyMod.Alt | KeyCode.RightArrow },
weight: KeybindingsRegistry.WEIGHT.editorContrib()
}
});
}
......@@ -225,7 +229,8 @@ export class CursorWordEndRightSelect extends WordRightCommand {
kbOpts: {
kbExpr: EditorContextKeys.textInputFocus,
primary: KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.RightArrow,
mac: { primary: KeyMod.Alt | KeyMod.Shift | KeyCode.RightArrow }
mac: { primary: KeyMod.Alt | KeyMod.Shift | KeyCode.RightArrow },
weight: KeybindingsRegistry.WEIGHT.editorContrib()
}
});
}
......@@ -330,7 +335,8 @@ export class DeleteWordLeft extends DeleteWordLeftCommand {
kbOpts: {
kbExpr: EditorContextKeys.textInputFocus,
primary: KeyMod.CtrlCmd | KeyCode.Backspace,
mac: { primary: KeyMod.Alt | KeyCode.Backspace }
mac: { primary: KeyMod.Alt | KeyCode.Backspace },
weight: KeybindingsRegistry.WEIGHT.editorContrib()
}
});
}
......@@ -368,7 +374,8 @@ export class DeleteWordRight extends DeleteWordRightCommand {
kbOpts: {
kbExpr: EditorContextKeys.textInputFocus,
primary: KeyMod.CtrlCmd | KeyCode.Delete,
mac: { primary: KeyMod.Alt | KeyCode.Delete }
mac: { primary: KeyMod.Alt | KeyCode.Delete },
weight: KeybindingsRegistry.WEIGHT.editorContrib()
}
});
}
......
......@@ -15,6 +15,7 @@ import { WordNavigationType, WordPartOperations } from 'vs/editor/common/control
import { WordCharacterClassifier } from 'vs/editor/common/controller/wordCharacterClassifier';
import { DeleteWordCommand, MoveWordCommand } from '../wordOperations/wordOperations';
import { Position } from 'vs/editor/common/core/position';
import { KeybindingsRegistry } from 'vs/platform/keybinding/common/keybindingsRegistry';
export class DeleteWordPartLeft extends DeleteWordCommand {
constructor() {
......@@ -26,7 +27,8 @@ export class DeleteWordPartLeft extends DeleteWordCommand {
kbOpts: {
kbExpr: EditorContextKeys.textInputFocus,
primary: KeyMod.CtrlCmd | KeyMod.Alt | KeyCode.Backspace,
mac: { primary: KeyMod.WinCtrl | KeyMod.Alt | KeyCode.Backspace }
mac: { primary: KeyMod.WinCtrl | KeyMod.Alt | KeyCode.Backspace },
weight: KeybindingsRegistry.WEIGHT.editorContrib()
}
});
}
......@@ -50,7 +52,8 @@ export class DeleteWordPartRight extends DeleteWordCommand {
kbOpts: {
kbExpr: EditorContextKeys.textInputFocus,
primary: KeyMod.CtrlCmd | KeyMod.Alt | KeyCode.Delete,
mac: { primary: KeyMod.WinCtrl | KeyMod.Alt | KeyCode.Delete }
mac: { primary: KeyMod.WinCtrl | KeyMod.Alt | KeyCode.Delete },
weight: KeybindingsRegistry.WEIGHT.editorContrib()
}
});
}
......@@ -81,7 +84,8 @@ export class CursorWordPartLeft extends WordPartLeftCommand {
kbOpts: {
kbExpr: EditorContextKeys.textInputFocus,
primary: KeyMod.CtrlCmd | KeyMod.Alt | KeyCode.LeftArrow,
mac: { primary: KeyMod.WinCtrl | KeyMod.Alt | KeyCode.LeftArrow }
mac: { primary: KeyMod.WinCtrl | KeyMod.Alt | KeyCode.LeftArrow },
weight: KeybindingsRegistry.WEIGHT.editorContrib()
}
});
}
......@@ -96,7 +100,8 @@ export class CursorWordPartLeftSelect extends WordPartLeftCommand {
kbOpts: {
kbExpr: EditorContextKeys.textInputFocus,
primary: KeyMod.CtrlCmd | KeyMod.Alt | KeyMod.Shift | KeyCode.LeftArrow,
mac: { primary: KeyMod.WinCtrl | KeyMod.Alt | KeyMod.Shift | KeyCode.LeftArrow }
mac: { primary: KeyMod.WinCtrl | KeyMod.Alt | KeyMod.Shift | KeyCode.LeftArrow },
weight: KeybindingsRegistry.WEIGHT.editorContrib()
}
});
}
......@@ -117,7 +122,8 @@ export class CursorWordPartRight extends WordPartRightCommand {
kbOpts: {
kbExpr: EditorContextKeys.textInputFocus,
primary: KeyMod.CtrlCmd | KeyMod.Alt | KeyCode.RightArrow,
mac: { primary: KeyMod.WinCtrl | KeyMod.Alt | KeyCode.RightArrow }
mac: { primary: KeyMod.WinCtrl | KeyMod.Alt | KeyCode.RightArrow },
weight: KeybindingsRegistry.WEIGHT.editorContrib()
}
});
}
......@@ -132,7 +138,8 @@ export class CursorWordPartRightSelect extends WordPartRightCommand {
kbOpts: {
kbExpr: EditorContextKeys.textInputFocus,
primary: KeyMod.CtrlCmd | KeyMod.Alt | KeyMod.Shift | KeyCode.RightArrow,
mac: { primary: KeyMod.WinCtrl | KeyMod.Alt | KeyMod.Shift | KeyCode.RightArrow }
mac: { primary: KeyMod.WinCtrl | KeyMod.Alt | KeyMod.Shift | KeyCode.RightArrow },
weight: KeybindingsRegistry.WEIGHT.editorContrib()
}
});
}
......
......@@ -342,7 +342,8 @@ class ShowAccessibilityHelpAction extends EditorAction {
precondition: null,
kbOpts: {
kbExpr: EditorContextKeys.focus,
primary: (browser.isIE ? KeyMod.CtrlCmd | KeyCode.F1 : KeyMod.Alt | KeyCode.F1)
primary: (browser.isIE ? KeyMod.CtrlCmd | KeyCode.F1 : KeyMod.Alt | KeyCode.F1),
weight: KeybindingsRegistry.WEIGHT.editorContrib()
}
});
}
......
......@@ -18,6 +18,7 @@ import { KeyCode, KeyMod } from 'vs/base/common/keyCodes';
import { Position } from 'vs/editor/common/core/position';
import { Range } from 'vs/editor/common/core/range';
import { ITextModel } from 'vs/editor/common/model';
import { KeybindingsRegistry } from 'vs/platform/keybinding/common/keybindingsRegistry';
interface ParseResult {
position: Position;
......@@ -153,7 +154,8 @@ export class GotoLineAction extends BaseEditorQuickOpenAction {
kbOpts: {
kbExpr: EditorContextKeys.focus,
primary: KeyMod.CtrlCmd | KeyCode.KEY_G,
mac: { primary: KeyMod.WinCtrl | KeyCode.KEY_G }
mac: { primary: KeyMod.WinCtrl | KeyCode.KEY_G },
weight: KeybindingsRegistry.WEIGHT.editorContrib()
}
});
}
......
......@@ -18,6 +18,7 @@ import { registerEditorAction, ServicesAccessor } from 'vs/editor/browser/editor
import { KeyCode, KeyMod } from 'vs/base/common/keyCodes';
import * as browser from 'vs/base/browser/browser';
import { ICodeEditor } from 'vs/editor/browser/editorBrowser';
import { KeybindingsRegistry } from 'vs/platform/keybinding/common/keybindingsRegistry';
export class EditorActionCommandEntry extends QuickOpenEntryGroup {
private key: string;
......@@ -79,7 +80,8 @@ export class QuickCommandAction extends BaseEditorQuickOpenAction {
precondition: null,
kbOpts: {
kbExpr: EditorContextKeys.focus,
primary: (browser.isIE ? KeyMod.Alt | KeyCode.F1 : KeyCode.F1)
primary: (browser.isIE ? KeyMod.Alt | KeyCode.F1 : KeyCode.F1),
weight: KeybindingsRegistry.WEIGHT.editorContrib()
},
menuOpts: {
}
......
......@@ -22,6 +22,7 @@ import { registerEditorAction, ServicesAccessor } from 'vs/editor/browser/editor
import { KeyCode, KeyMod } from 'vs/base/common/keyCodes';
import { Range, IRange } from 'vs/editor/common/core/range';
import { ICodeEditor } from 'vs/editor/browser/editorBrowser';
import { KeybindingsRegistry } from 'vs/platform/keybinding/common/keybindingsRegistry';
let SCOPE_PREFIX = ':';
......@@ -120,7 +121,8 @@ export class QuickOutlineAction extends BaseEditorQuickOpenAction {
precondition: EditorContextKeys.hasDocumentSymbolProvider,
kbOpts: {
kbExpr: EditorContextKeys.focus,
primary: KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.KEY_O
primary: KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.KEY_O,
weight: KeybindingsRegistry.WEIGHT.editorContrib()
},
menuOpts: {
group: 'navigation',
......
......@@ -286,7 +286,8 @@ class ShowAccessibilityHelpAction extends EditorAction {
precondition: null,
kbOpts: {
kbExpr: EditorContextKeys.focus,
primary: KeyMod.Alt | KeyCode.F1
primary: KeyMod.Alt | KeyCode.F1,
weight: KeybindingsRegistry.WEIGHT.editorContrib()
}
});
}
......
......@@ -18,6 +18,7 @@ import { InternalEditorOptions, EDITOR_DEFAULTS } from 'vs/editor/common/config/
import { ITextResourceConfigurationService } from 'vs/editor/common/services/resourceConfiguration';
import { ICodeEditor } from 'vs/editor/browser/editorBrowser';
import { INotificationService } from 'vs/platform/notification/common/notification';
import { KeybindingsRegistry } from 'vs/platform/keybinding/common/keybindingsRegistry';
const transientWordWrapState = 'transientWordWrapState';
const isWordWrapMinifiedKey = 'isWordWrapMinified';
......@@ -141,7 +142,8 @@ class ToggleWordWrapAction extends EditorAction {
precondition: null,
kbOpts: {
kbExpr: null,
primary: KeyMod.Alt | KeyCode.KEY_Z
primary: KeyMod.Alt | KeyCode.KEY_Z,
weight: KeybindingsRegistry.WEIGHT.editorContrib()
}
});
}
......
......@@ -16,6 +16,7 @@ import { IViewletService } from 'vs/workbench/services/viewlet/browser/viewlet';
import { ICodeEditor } from 'vs/editor/browser/editorBrowser';
import { IEditorService } from 'vs/workbench/services/editor/common/editorService';
import { openBreakpointSource } from 'vs/workbench/parts/debug/browser/breakpointsView';
import { KeybindingsRegistry } from 'vs/platform/keybinding/common/keybindingsRegistry';
export const TOGGLE_BREAKPOINT_ID = 'editor.debug.action.toggleBreakpoint';
class ToggleBreakpointAction extends EditorAction {
......@@ -27,7 +28,8 @@ class ToggleBreakpointAction extends EditorAction {
precondition: null,
kbOpts: {
kbExpr: EditorContextKeys.editorTextFocus,
primary: KeyCode.F9
primary: KeyCode.F9,
weight: KeybindingsRegistry.WEIGHT.editorContrib()
}
});
}
......@@ -197,7 +199,8 @@ class ShowDebugHoverAction extends EditorAction {
precondition: CONTEXT_IN_DEBUG_MODE,
kbOpts: {
kbExpr: EditorContextKeys.editorTextFocus,
primary: KeyChord(KeyMod.CtrlCmd | KeyCode.KEY_K, KeyMod.CtrlCmd | KeyCode.KEY_I)
primary: KeyChord(KeyMod.CtrlCmd | KeyCode.KEY_K, KeyMod.CtrlCmd | KeyCode.KEY_I),
weight: KeybindingsRegistry.WEIGHT.editorContrib()
}
});
}
......
......@@ -33,6 +33,7 @@ import { transparent, editorForeground } from 'vs/platform/theme/common/colorReg
import { ServiceCollection } from 'vs/platform/instantiation/common/serviceCollection';
import { IDecorationOptions } from 'vs/editor/common/editorCommon';
import { CodeEditorWidget } from 'vs/editor/browser/widget/codeEditorWidget';
import { KeybindingsRegistry } from 'vs/platform/keybinding/common/keybindingsRegistry';
const $ = dom.$;
const IPrivateBreakpointWidgetService = createDecorator<IPrivateBreakpointWidgetService>('privateBreakopintWidgetService');
......@@ -296,7 +297,8 @@ class AcceptBreakpointWidgetInputAction extends EditorCommand {
precondition: CONTEXT_BREAKPOINT_WIDGET_VISIBLE,
kbOpts: {
kbExpr: CONTEXT_IN_BREAKPOINT_WIDGET,
primary: KeyCode.Enter
primary: KeyCode.Enter,
weight: KeybindingsRegistry.WEIGHT.editorContrib()
}
});
}
......@@ -315,7 +317,8 @@ class CloseBreakpointWidgetCommand extends EditorCommand {
kbOpts: {
kbExpr: EditorContextKeys.textInputFocus,
primary: KeyCode.Escape,
secondary: [KeyMod.Shift | KeyCode.Escape]
secondary: [KeyMod.Shift | KeyCode.Escape],
weight: KeybindingsRegistry.WEIGHT.editorContrib()
}
});
}
......
......@@ -47,6 +47,7 @@ import { IDebugService, REPL_ID, DEBUG_SCHEME, CONTEXT_IN_DEBUG_REPL } from 'vs/
import { HistoryNavigator } from 'vs/base/common/history';
import { IHistoryNavigationWidget } from 'vs/base/browser/history';
import { createAndBindHistoryNavigationWidgetScopedContextKeyService } from 'vs/platform/widget/browser/contextScopedHistoryWidget';
import { KeybindingsRegistry } from 'vs/platform/keybinding/common/keybindingsRegistry';
const $ = dom.$;
......@@ -315,7 +316,8 @@ class AcceptReplInputAction extends EditorAction {
precondition: CONTEXT_IN_DEBUG_REPL,
kbOpts: {
kbExpr: EditorContextKeys.textInputFocus,
primary: KeyCode.Enter
primary: KeyCode.Enter,
weight: KeybindingsRegistry.WEIGHT.editorContrib()
}
});
}
......
......@@ -10,6 +10,7 @@ import { registerEditorAction } from 'vs/editor/browser/editorExtensions';
import { EditorContextKeys } from 'vs/editor/common/editorContextKeys';
import { KeyCode } from 'vs/base/common/keyCodes';
import { ContextKeyExpr } from 'vs/platform/contextkey/common/contextkey';
import { KeybindingsRegistry } from 'vs/platform/keybinding/common/keybindingsRegistry';
class ExpandAbbreviationAction extends EmmetEditorAction {
......@@ -26,7 +27,8 @@ class ExpandAbbreviationAction extends EmmetEditorAction {
EditorContextKeys.editorTextFocus,
EditorContextKeys.tabDoesNotMoveFocus,
ContextKeyExpr.has('config.emmet.triggerExpansionOnTab')
)
),
weight: KeybindingsRegistry.WEIGHT.editorContrib()
}
});
......
......@@ -1121,7 +1121,8 @@ const showCommand = new ShowExtensionEditorFindCommand({
id: 'editor.action.extensioneditor.showfind',
precondition: KEYBINDING_CONTEXT_EXTENSIONEDITOR_WEBVIEW_FOCUS,
kbOpts: {
primary: KeyMod.CtrlCmd | KeyCode.KEY_F
primary: KeyMod.CtrlCmd | KeyCode.KEY_F,
weight: KeybindingsRegistry.WEIGHT.editorContrib()
}
});
showCommand.register(KeybindingsRegistry.WEIGHT.editorContrib());
showCommand.register();
......@@ -29,6 +29,7 @@ import { WindowsNativeResolvedKeybinding } from 'vs/workbench/services/keybindin
import { themeColorFromId, ThemeColor } from 'vs/platform/theme/common/themeService';
import { overviewRulerInfo, overviewRulerError } from 'vs/editor/common/view/editorColorRegistry';
import { IModelDeltaDecoration, ITextModel, TrackedRangeStickiness, OverviewRulerLane } from 'vs/editor/common/model';
import { KeybindingsRegistry } from 'vs/platform/keybinding/common/keybindingsRegistry';
const NLS_LAUNCH_MESSAGE = nls.localize('defineKeybinding.start', "Define Keybinding");
const NLS_KB_LAYOUT_ERROR_MESSAGE = nls.localize('defineKeybinding.kbLayoutErrorMessage', "You won't be able to produce this key combination under your current keyboard layout.");
......@@ -365,7 +366,8 @@ class DefineKeybindingCommand extends EditorCommand {
precondition: ContextKeyExpr.and(EditorContextKeys.writable, EditorContextKeys.languageId.isEqualTo('jsonc')),
kbOpts: {
kbExpr: EditorContextKeys.editorTextFocus,
primary: KeyChord(KeyMod.CtrlCmd | KeyCode.KEY_K, KeyMod.CtrlCmd | KeyCode.KEY_K)
primary: KeyChord(KeyMod.CtrlCmd | KeyCode.KEY_K, KeyMod.CtrlCmd | KeyCode.KEY_K),
weight: KeybindingsRegistry.WEIGHT.editorContrib()
}
});
}
......
......@@ -351,9 +351,9 @@ class StartSearchDefaultSettingsCommand extends SettingsCommand {
const startSearchCommand = new StartSearchDefaultSettingsCommand({
id: SETTINGS_EDITOR_COMMAND_SEARCH,
precondition: ContextKeyExpr.and(CONTEXT_SETTINGS_EDITOR),
kbOpts: { primary: KeyMod.CtrlCmd | KeyCode.KEY_F }
kbOpts: { primary: KeyMod.CtrlCmd | KeyCode.KEY_F, weight: KeybindingsRegistry.WEIGHT.editorContrib() }
});
startSearchCommand.register(KeybindingsRegistry.WEIGHT.editorContrib());
startSearchCommand.register();
class FocusSearchFromSettingsCommand extends SettingsCommand {
......@@ -367,9 +367,9 @@ class FocusSearchFromSettingsCommand extends SettingsCommand {
const focusSearchFromSettingsCommand = new FocusSearchFromSettingsCommand({
id: SETTINGS_EDITOR_COMMAND_FOCUS_SEARCH_FROM_SETTINGS,
precondition: ContextKeyExpr.and(CONTEXT_SETTINGS_EDITOR, CONTEXT_SETTINGS_FIRST_ROW_FOCUS),
kbOpts: { primary: KeyCode.UpArrow }
kbOpts: { primary: KeyCode.UpArrow, weight: KeybindingsRegistry.WEIGHT.workbenchContrib() }
});
focusSearchFromSettingsCommand.register(KeybindingsRegistry.WEIGHT.workbenchContrib());
focusSearchFromSettingsCommand.register();
class ClearSearchResultsCommand extends SettingsCommand {
......@@ -384,9 +384,9 @@ class ClearSearchResultsCommand extends SettingsCommand {
const clearSearchResultsCommand = new ClearSearchResultsCommand({
id: SETTINGS_EDITOR_COMMAND_CLEAR_SEARCH_RESULTS,
precondition: CONTEXT_SETTINGS_SEARCH_FOCUS,
kbOpts: { primary: KeyCode.Escape }
kbOpts: { primary: KeyCode.Escape, weight: KeybindingsRegistry.WEIGHT.editorContrib() }
});
clearSearchResultsCommand.register(KeybindingsRegistry.WEIGHT.editorContrib());
clearSearchResultsCommand.register();
class FocusSettingsFileEditorCommand extends SettingsCommand {
......@@ -402,16 +402,16 @@ class FocusSettingsFileEditorCommand extends SettingsCommand {
const focusSettingsFileEditorCommand = new FocusSettingsFileEditorCommand({
id: SETTINGS_EDITOR_COMMAND_FOCUS_FILE,
precondition: CONTEXT_SETTINGS_SEARCH_FOCUS,
kbOpts: { primary: KeyCode.DownArrow }
kbOpts: { primary: KeyCode.DownArrow, weight: KeybindingsRegistry.WEIGHT.editorContrib() }
});
focusSettingsFileEditorCommand.register(KeybindingsRegistry.WEIGHT.editorContrib());
focusSettingsFileEditorCommand.register();
const focusSettingsFromSearchCommand = new FocusSettingsFileEditorCommand({
id: SETTINGS_EDITOR_COMMAND_FOCUS_SETTINGS_FROM_SEARCH,
precondition: CONTEXT_SETTINGS_SEARCH_FOCUS,
kbOpts: { primary: KeyCode.DownArrow }
kbOpts: { primary: KeyCode.DownArrow, weight: KeybindingsRegistry.WEIGHT.workbenchContrib() }
});
focusSettingsFromSearchCommand.register(KeybindingsRegistry.WEIGHT.workbenchContrib());
focusSettingsFromSearchCommand.register();
class FocusNextSearchResultCommand extends SettingsCommand {
......@@ -425,9 +425,9 @@ class FocusNextSearchResultCommand extends SettingsCommand {
const focusNextSearchResultCommand = new FocusNextSearchResultCommand({
id: SETTINGS_EDITOR_COMMAND_FOCUS_NEXT_SETTING,
precondition: CONTEXT_SETTINGS_SEARCH_FOCUS,
kbOpts: { primary: KeyCode.Enter }
kbOpts: { primary: KeyCode.Enter, weight: KeybindingsRegistry.WEIGHT.editorContrib() }
});
focusNextSearchResultCommand.register(KeybindingsRegistry.WEIGHT.editorContrib());
focusNextSearchResultCommand.register();
class FocusPreviousSearchResultCommand extends SettingsCommand {
......@@ -441,9 +441,9 @@ class FocusPreviousSearchResultCommand extends SettingsCommand {
const focusPreviousSearchResultCommand = new FocusPreviousSearchResultCommand({
id: SETTINGS_EDITOR_COMMAND_FOCUS_PREVIOUS_SETTING,
precondition: CONTEXT_SETTINGS_SEARCH_FOCUS,
kbOpts: { primary: KeyMod.Shift | KeyCode.Enter }
kbOpts: { primary: KeyMod.Shift | KeyCode.Enter, weight: KeybindingsRegistry.WEIGHT.editorContrib() }
});
focusPreviousSearchResultCommand.register(KeybindingsRegistry.WEIGHT.editorContrib());
focusPreviousSearchResultCommand.register();
class EditFocusedSettingCommand extends SettingsCommand {
......@@ -457,9 +457,9 @@ class EditFocusedSettingCommand extends SettingsCommand {
const editFocusedSettingCommand = new EditFocusedSettingCommand({
id: SETTINGS_EDITOR_COMMAND_EDIT_FOCUSED_SETTING,
precondition: CONTEXT_SETTINGS_SEARCH_FOCUS,
kbOpts: { primary: KeyMod.CtrlCmd | KeyCode.US_DOT }
kbOpts: { primary: KeyMod.CtrlCmd | KeyCode.US_DOT, weight: KeybindingsRegistry.WEIGHT.editorContrib() }
});
editFocusedSettingCommand.register(KeybindingsRegistry.WEIGHT.editorContrib());
editFocusedSettingCommand.register();
class EditFocusedSettingCommand2 extends SettingsCommand {
......@@ -474,9 +474,9 @@ class EditFocusedSettingCommand2 extends SettingsCommand {
const editFocusedSettingCommand2 = new EditFocusedSettingCommand2({
id: SETTINGS_EDITOR_COMMAND_EDIT_FOCUSED_SETTING,
precondition: ContextKeyExpr.and(CONTEXT_SETTINGS_EDITOR, CONTEXT_SETTINGS_ROW_FOCUS),
kbOpts: { primary: KeyCode.Enter }
kbOpts: { primary: KeyCode.Enter, weight: KeybindingsRegistry.WEIGHT.workbenchContrib() }
});
editFocusedSettingCommand2.register(KeybindingsRegistry.WEIGHT.workbenchContrib());
editFocusedSettingCommand2.register();
class FocusSettingsListCommand extends SettingsCommand {
......@@ -491,9 +491,9 @@ class FocusSettingsListCommand extends SettingsCommand {
const focusSettingsListCommand = new FocusSettingsListCommand({
id: SETTINGS_EDITOR_COMMAND_FOCUS_SETTINGS_LIST,
precondition: ContextKeyExpr.and(CONTEXT_SETTINGS_EDITOR, CONTEXT_TOC_ROW_FOCUS),
kbOpts: { primary: KeyCode.Enter }
kbOpts: { primary: KeyCode.Enter, weight: KeybindingsRegistry.WEIGHT.workbenchContrib() }
});
focusSettingsListCommand.register(KeybindingsRegistry.WEIGHT.workbenchContrib());
focusSettingsListCommand.register();
// Preferences menu
......
......@@ -372,7 +372,7 @@ export class ShowPreviousChangeAction extends EditorAction {
label: nls.localize('show previous change', "Show Previous Change"),
alias: 'Show Previous Change',
precondition: null,
kbOpts: { kbExpr: EditorContextKeys.editorTextFocus, primary: KeyMod.Shift | KeyMod.Alt | KeyCode.F3 }
kbOpts: { kbExpr: EditorContextKeys.editorTextFocus, primary: KeyMod.Shift | KeyMod.Alt | KeyCode.F3, weight: KeybindingsRegistry.WEIGHT.editorContrib() }
});
}
......@@ -406,7 +406,7 @@ export class ShowNextChangeAction extends EditorAction {
label: nls.localize('show next change', "Show Next Change"),
alias: 'Show Next Change',
precondition: null,
kbOpts: { kbExpr: EditorContextKeys.editorTextFocus, primary: KeyMod.Alt | KeyCode.F3 }
kbOpts: { kbExpr: EditorContextKeys.editorTextFocus, primary: KeyMod.Alt | KeyCode.F3, weight: KeybindingsRegistry.WEIGHT.editorContrib() }
});
}
......@@ -440,7 +440,7 @@ export class MoveToPreviousChangeAction extends EditorAction {
label: nls.localize('move to previous change', "Move to Previous Change"),
alias: 'Move to Previous Change',
precondition: null,
kbOpts: { kbExpr: EditorContextKeys.editorTextFocus, primary: KeyMod.Shift | KeyMod.Alt | KeyCode.F5 }
kbOpts: { kbExpr: EditorContextKeys.editorTextFocus, primary: KeyMod.Shift | KeyMod.Alt | KeyCode.F5, weight: KeybindingsRegistry.WEIGHT.editorContrib() }
});
}
......@@ -482,7 +482,7 @@ export class MoveToNextChangeAction extends EditorAction {
label: nls.localize('move to next change', "Move to Next Change"),
alias: 'Move to Next Change',
precondition: null,
kbOpts: { kbExpr: EditorContextKeys.editorTextFocus, primary: KeyMod.Alt | KeyCode.F5 }
kbOpts: { kbExpr: EditorContextKeys.editorTextFocus, primary: KeyMod.Alt | KeyCode.F5, weight: KeybindingsRegistry.WEIGHT.editorContrib() }
});
}
......
......@@ -42,10 +42,11 @@ const showNextFindWdigetCommand = new ShowWebViewEditorFindWidgetCommand({
id: ShowWebViewEditorFindWidgetCommand.ID,
precondition: KEYBINDING_CONTEXT_WEBVIEWEDITOR_FOCUS,
kbOpts: {
primary: KeyMod.CtrlCmd | KeyCode.KEY_F
primary: KeyMod.CtrlCmd | KeyCode.KEY_F,
weight: KeybindingsRegistry.WEIGHT.editorContrib()
}
});
showNextFindWdigetCommand.register(KeybindingsRegistry.WEIGHT.editorContrib());
showNextFindWdigetCommand.register();
const hideCommand = new HideWebViewEditorFindCommand({
id: HideWebViewEditorFindCommand.ID,
......@@ -53,19 +54,21 @@ const hideCommand = new HideWebViewEditorFindCommand({
KEYBINDING_CONTEXT_WEBVIEWEDITOR_FOCUS,
KEYBINDING_CONTEXT_WEBVIEW_FIND_WIDGET_VISIBLE),
kbOpts: {
primary: KeyCode.Escape
primary: KeyCode.Escape,
weight: KeybindingsRegistry.WEIGHT.editorContrib()
}
});
hideCommand.register(KeybindingsRegistry.WEIGHT.editorContrib());
hideCommand.register();
const selectAllCommand = new SelectAllWebviewEditorCommand({
id: SelectAllWebviewEditorCommand.ID,
precondition: KEYBINDING_CONTEXT_WEBVIEWEDITOR_FOCUS,
kbOpts: {
primary: KeyMod.CtrlCmd | KeyCode.KEY_A
primary: KeyMod.CtrlCmd | KeyCode.KEY_A,
weight: KeybindingsRegistry.WEIGHT.editorContrib()
}
});
selectAllCommand.register(KeybindingsRegistry.WEIGHT.editorContrib());
selectAllCommand.register();
actionRegistry.registerWorkbenchAction(
new SyncActionDescriptor(OpenWebviewDeveloperToolsAction, OpenWebviewDeveloperToolsAction.ID, OpenWebviewDeveloperToolsAction.LABEL),
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册