mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-03-20 20:10:11 -04:00
This reverts commit 5d44b6a6a7.
This commit is contained in:
@@ -31,7 +31,7 @@ class JumpToBracketAction extends EditorAction {
|
||||
id: 'editor.action.jumpToBracket',
|
||||
label: nls.localize('smartSelect.jumpBracket', "Go to Bracket"),
|
||||
alias: 'Go to Bracket',
|
||||
precondition: undefined,
|
||||
precondition: null,
|
||||
kbOpts: {
|
||||
kbExpr: EditorContextKeys.editorTextFocus,
|
||||
primary: KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.US_BACKSLASH,
|
||||
@@ -55,7 +55,7 @@ class SelectToBracketAction extends EditorAction {
|
||||
id: 'editor.action.selectToBracket',
|
||||
label: nls.localize('smartSelect.selectToBracket', "Select to Bracket"),
|
||||
alias: 'Select to Bracket',
|
||||
precondition: undefined
|
||||
precondition: null
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -59,7 +59,7 @@ abstract class ExecCommandAction extends EditorAction {
|
||||
class ExecCommandCutAction extends ExecCommandAction {
|
||||
|
||||
constructor() {
|
||||
let kbOpts: ICommandKeybindingsOptions | undefined = {
|
||||
let kbOpts: ICommandKeybindingsOptions | null = {
|
||||
kbExpr: EditorContextKeys.textInputFocus,
|
||||
primary: KeyMod.CtrlCmd | KeyCode.KEY_X,
|
||||
win: { primary: KeyMod.CtrlCmd | KeyCode.KEY_X, secondary: [KeyMod.Shift | KeyCode.Delete] },
|
||||
@@ -68,7 +68,7 @@ class ExecCommandCutAction extends ExecCommandAction {
|
||||
// Do not bind cut keybindings in the browser,
|
||||
// since browsers do that for us and it avoids security prompts
|
||||
if (!platform.isNative) {
|
||||
kbOpts = undefined;
|
||||
kbOpts = null;
|
||||
}
|
||||
super('cut', {
|
||||
id: 'editor.action.clipboardCutAction',
|
||||
@@ -107,7 +107,7 @@ class ExecCommandCutAction extends ExecCommandAction {
|
||||
class ExecCommandCopyAction extends ExecCommandAction {
|
||||
|
||||
constructor() {
|
||||
let kbOpts: ICommandKeybindingsOptions | undefined = {
|
||||
let kbOpts: ICommandKeybindingsOptions | null = {
|
||||
kbExpr: EditorContextKeys.textInputFocus,
|
||||
primary: KeyMod.CtrlCmd | KeyCode.KEY_C,
|
||||
win: { primary: KeyMod.CtrlCmd | KeyCode.KEY_C, secondary: [KeyMod.CtrlCmd | KeyCode.Insert] },
|
||||
@@ -116,14 +116,14 @@ class ExecCommandCopyAction extends ExecCommandAction {
|
||||
// Do not bind copy keybindings in the browser,
|
||||
// since browsers do that for us and it avoids security prompts
|
||||
if (!platform.isNative) {
|
||||
kbOpts = undefined;
|
||||
kbOpts = null;
|
||||
}
|
||||
|
||||
super('copy', {
|
||||
id: 'editor.action.clipboardCopyAction',
|
||||
label: nls.localize('actions.clipboard.copyLabel', "Copy"),
|
||||
alias: 'Copy',
|
||||
precondition: undefined,
|
||||
precondition: null,
|
||||
kbOpts: kbOpts,
|
||||
menuOpts: {
|
||||
group: CLIPBOARD_CONTEXT_MENU_GROUP,
|
||||
@@ -162,7 +162,7 @@ class ExecCommandCopyAction extends ExecCommandAction {
|
||||
class ExecCommandPasteAction extends ExecCommandAction {
|
||||
|
||||
constructor() {
|
||||
let kbOpts: ICommandKeybindingsOptions | undefined = {
|
||||
let kbOpts: ICommandKeybindingsOptions | null = {
|
||||
kbExpr: EditorContextKeys.textInputFocus,
|
||||
primary: KeyMod.CtrlCmd | KeyCode.KEY_V,
|
||||
win: { primary: KeyMod.CtrlCmd | KeyCode.KEY_V, secondary: [KeyMod.Shift | KeyCode.Insert] },
|
||||
@@ -171,7 +171,7 @@ class ExecCommandPasteAction extends ExecCommandAction {
|
||||
// Do not bind paste keybindings in the browser,
|
||||
// since browsers do that for us and it avoids security prompts
|
||||
if (!platform.isNative) {
|
||||
kbOpts = undefined;
|
||||
kbOpts = null;
|
||||
}
|
||||
|
||||
super('paste', {
|
||||
@@ -201,7 +201,7 @@ class ExecCommandCopyWithSyntaxHighlightingAction extends ExecCommandAction {
|
||||
id: 'editor.action.clipboardCopyWithSyntaxHighlightingAction',
|
||||
label: nls.localize('actions.clipboard.copyWithSyntaxHighlightingLabel', "Copy With Syntax Highlighting"),
|
||||
alias: 'Copy With Syntax Highlighting',
|
||||
precondition: undefined,
|
||||
precondition: null,
|
||||
kbOpts: {
|
||||
kbExpr: EditorContextKeys.textInputFocus,
|
||||
primary: 0,
|
||||
|
||||
@@ -34,8 +34,8 @@ export class CodeActionSet {
|
||||
|
||||
public readonly actions: readonly CodeAction[];
|
||||
|
||||
public constructor(actions: readonly CodeAction[]) {
|
||||
this.actions = mergeSort([...actions], CodeActionSet.codeActionsComparator);
|
||||
public constructor(actions: CodeAction[]) {
|
||||
this.actions = mergeSort(actions, CodeActionSet.codeActionsComparator);
|
||||
}
|
||||
|
||||
public get hasAutoFix() {
|
||||
|
||||
@@ -176,7 +176,6 @@ function showCodeActionsForEditorSelection(
|
||||
return;
|
||||
}
|
||||
|
||||
MessageController.get(editor).closeMessage();
|
||||
const pos = editor.getPosition();
|
||||
controller.triggerFromEditorSelection(filter, autoApply).then(codeActions => {
|
||||
if (!codeActions || !codeActions.actions.length) {
|
||||
|
||||
@@ -20,12 +20,8 @@ export class CodeActionKind {
|
||||
public readonly value: string
|
||||
) { }
|
||||
|
||||
public equals(other: CodeActionKind): boolean {
|
||||
return this.value === other.value;
|
||||
}
|
||||
|
||||
public contains(other: CodeActionKind): boolean {
|
||||
return this.equals(other) || startsWith(other.value, this.value + CodeActionKind.sep);
|
||||
return this.value === other.value || startsWith(other.value, this.value + CodeActionKind.sep);
|
||||
}
|
||||
|
||||
public intersects(other: CodeActionKind): boolean {
|
||||
|
||||
@@ -76,9 +76,9 @@ export class ColorDetector implements IEditorContribution {
|
||||
}
|
||||
const languageId = model.getLanguageIdentifier();
|
||||
// handle deprecated settings. [languageId].colorDecorators.enable
|
||||
const deprecatedConfig = this._configurationService.getValue<{}>(languageId.language);
|
||||
let deprecatedConfig = this._configurationService.getValue(languageId.language);
|
||||
if (deprecatedConfig) {
|
||||
const colorDecorators = deprecatedConfig['colorDecorators']; // deprecatedConfig.valueOf('.colorDecorators.enable');
|
||||
let colorDecorators = deprecatedConfig['colorDecorators']; // deprecatedConfig.valueOf('.colorDecorators.enable');
|
||||
if (colorDecorators && colorDecorators['enable'] !== undefined && !colorDecorators['enable']) {
|
||||
return colorDecorators['enable'];
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
import * as nls from 'vs/nls';
|
||||
import * as dom from 'vs/base/browser/dom';
|
||||
import { IKeyboardEvent } from 'vs/base/browser/keyboardEvent';
|
||||
import { ActionViewItem, Separator } from 'vs/base/browser/ui/actionbar/actionbar';
|
||||
import { ActionItem, Separator } from 'vs/base/browser/ui/actionbar/actionbar';
|
||||
import { IAnchor } from 'vs/base/browser/ui/contextview/contextview';
|
||||
import { IAction } from 'vs/base/common/actions';
|
||||
import { KeyCode, KeyMod, ResolvedKeybinding } from 'vs/base/common/keyCodes';
|
||||
@@ -176,18 +176,18 @@ export class ContextMenuController implements IEditorContribution {
|
||||
|
||||
getActions: () => actions,
|
||||
|
||||
getActionViewItem: (action) => {
|
||||
getActionItem: (action) => {
|
||||
const keybinding = this._keybindingFor(action);
|
||||
if (keybinding) {
|
||||
return new ActionViewItem(action, action, { label: true, keybinding: keybinding.getLabel(), isMenu: true });
|
||||
return new ActionItem(action, action, { label: true, keybinding: keybinding.getLabel(), isMenu: true });
|
||||
}
|
||||
|
||||
const customActionViewItem = <any>action;
|
||||
if (typeof customActionViewItem.getActionViewItem === 'function') {
|
||||
return customActionViewItem.getActionViewItem();
|
||||
const customActionItem = <any>action;
|
||||
if (typeof customActionItem.getActionItem === 'function') {
|
||||
return customActionItem.getActionItem();
|
||||
}
|
||||
|
||||
return new ActionViewItem(action, action, { icon: true, label: true, isMenu: true });
|
||||
return new ActionItem(action, action, { icon: true, label: true, isMenu: true });
|
||||
},
|
||||
|
||||
getKeyBinding: (action): ResolvedKeybinding | undefined => {
|
||||
@@ -228,7 +228,7 @@ class ShowContextMenu extends EditorAction {
|
||||
id: 'editor.action.showContextMenu',
|
||||
label: nls.localize('action.showContextMenu.label', "Show Editor Context Menu"),
|
||||
alias: 'Show Editor Context Menu',
|
||||
precondition: undefined,
|
||||
precondition: null,
|
||||
kbOpts: {
|
||||
kbExpr: EditorContextKeys.textInputFocus,
|
||||
primary: KeyMod.Shift | KeyCode.F10,
|
||||
|
||||
@@ -119,7 +119,7 @@ export class CursorUndo extends EditorAction {
|
||||
id: 'cursorUndo',
|
||||
label: nls.localize('cursor.undo', "Soft Undo"),
|
||||
alias: 'Soft Undo',
|
||||
precondition: undefined,
|
||||
precondition: null,
|
||||
kbOpts: {
|
||||
kbExpr: EditorContextKeys.textInputFocus,
|
||||
primary: KeyMod.CtrlCmd | KeyCode.KEY_U,
|
||||
|
||||
@@ -422,7 +422,7 @@ export class StartFindAction extends EditorAction {
|
||||
id: FIND_IDS.StartFindAction,
|
||||
label: nls.localize('startFindAction', "Find"),
|
||||
alias: 'Find',
|
||||
precondition: undefined,
|
||||
precondition: null,
|
||||
kbOpts: {
|
||||
kbExpr: null,
|
||||
primary: KeyMod.CtrlCmd | KeyCode.KEY_F,
|
||||
@@ -459,7 +459,7 @@ export class StartFindWithSelectionAction extends EditorAction {
|
||||
id: FIND_IDS.StartFindWithSelection,
|
||||
label: nls.localize('startFindWithSelectionAction', "Find With Selection"),
|
||||
alias: 'Find With Selection',
|
||||
precondition: undefined,
|
||||
precondition: null,
|
||||
kbOpts: {
|
||||
kbExpr: null,
|
||||
primary: 0,
|
||||
@@ -513,7 +513,7 @@ export class NextMatchFindAction extends MatchFindAction {
|
||||
id: FIND_IDS.NextMatchFindAction,
|
||||
label: nls.localize('findNextMatchAction', "Find Next"),
|
||||
alias: 'Find Next',
|
||||
precondition: undefined,
|
||||
precondition: null,
|
||||
kbOpts: {
|
||||
kbExpr: EditorContextKeys.focus,
|
||||
primary: KeyCode.F3,
|
||||
@@ -535,7 +535,7 @@ export class PreviousMatchFindAction extends MatchFindAction {
|
||||
id: FIND_IDS.PreviousMatchFindAction,
|
||||
label: nls.localize('findPreviousMatchAction', "Find Previous"),
|
||||
alias: 'Find Previous',
|
||||
precondition: undefined,
|
||||
precondition: null,
|
||||
kbOpts: {
|
||||
kbExpr: EditorContextKeys.focus,
|
||||
primary: KeyMod.Shift | KeyCode.F3,
|
||||
@@ -583,7 +583,7 @@ export class NextSelectionMatchFindAction extends SelectionMatchFindAction {
|
||||
id: FIND_IDS.NextSelectionMatchFindAction,
|
||||
label: nls.localize('nextSelectionMatchFindAction', "Find Next Selection"),
|
||||
alias: 'Find Next Selection',
|
||||
precondition: undefined,
|
||||
precondition: null,
|
||||
kbOpts: {
|
||||
kbExpr: EditorContextKeys.focus,
|
||||
primary: KeyMod.CtrlCmd | KeyCode.F3,
|
||||
@@ -604,7 +604,7 @@ export class PreviousSelectionMatchFindAction extends SelectionMatchFindAction {
|
||||
id: FIND_IDS.PreviousSelectionMatchFindAction,
|
||||
label: nls.localize('previousSelectionMatchFindAction', "Find Previous Selection"),
|
||||
alias: 'Find Previous Selection',
|
||||
precondition: undefined,
|
||||
precondition: null,
|
||||
kbOpts: {
|
||||
kbExpr: EditorContextKeys.focus,
|
||||
primary: KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.F3,
|
||||
@@ -625,7 +625,7 @@ export class StartFindReplaceAction extends EditorAction {
|
||||
id: FIND_IDS.StartFindReplaceAction,
|
||||
label: nls.localize('startReplace', "Replace"),
|
||||
alias: 'Replace',
|
||||
precondition: undefined,
|
||||
precondition: null,
|
||||
kbOpts: {
|
||||
kbExpr: null,
|
||||
primary: KeyMod.CtrlCmd | KeyCode.KEY_H,
|
||||
@@ -704,7 +704,7 @@ registerEditorCommand(new FindCommand({
|
||||
|
||||
registerEditorCommand(new FindCommand({
|
||||
id: FIND_IDS.ToggleCaseSensitiveCommand,
|
||||
precondition: undefined,
|
||||
precondition: null,
|
||||
handler: x => x.toggleCaseSensitive(),
|
||||
kbOpts: {
|
||||
weight: KeybindingWeight.EditorContrib + 5,
|
||||
@@ -718,7 +718,7 @@ registerEditorCommand(new FindCommand({
|
||||
|
||||
registerEditorCommand(new FindCommand({
|
||||
id: FIND_IDS.ToggleWholeWordCommand,
|
||||
precondition: undefined,
|
||||
precondition: null,
|
||||
handler: x => x.toggleWholeWords(),
|
||||
kbOpts: {
|
||||
weight: KeybindingWeight.EditorContrib + 5,
|
||||
@@ -732,7 +732,7 @@ registerEditorCommand(new FindCommand({
|
||||
|
||||
registerEditorCommand(new FindCommand({
|
||||
id: FIND_IDS.ToggleRegexCommand,
|
||||
precondition: undefined,
|
||||
precondition: null,
|
||||
handler: x => x.toggleRegex(),
|
||||
kbOpts: {
|
||||
weight: KeybindingWeight.EditorContrib + 5,
|
||||
@@ -746,7 +746,7 @@ registerEditorCommand(new FindCommand({
|
||||
|
||||
registerEditorCommand(new FindCommand({
|
||||
id: FIND_IDS.ToggleSearchScopeCommand,
|
||||
precondition: undefined,
|
||||
precondition: null,
|
||||
handler: x => x.toggleSearchScope(),
|
||||
kbOpts: {
|
||||
weight: KeybindingWeight.EditorContrib + 5,
|
||||
|
||||
@@ -503,7 +503,7 @@ class UnfoldAction extends FoldingAction<FoldingArguments> {
|
||||
id: 'editor.unfold',
|
||||
label: nls.localize('unfoldAction.label', "Unfold"),
|
||||
alias: 'Unfold',
|
||||
precondition: undefined,
|
||||
precondition: null,
|
||||
kbOpts: {
|
||||
kbExpr: EditorContextKeys.editorTextFocus,
|
||||
primary: KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.US_CLOSE_SQUARE_BRACKET,
|
||||
@@ -567,7 +567,7 @@ class UnFoldRecursivelyAction extends FoldingAction<void> {
|
||||
id: 'editor.unfoldRecursively',
|
||||
label: nls.localize('unFoldRecursivelyAction.label', "Unfold Recursively"),
|
||||
alias: 'Unfold Recursively',
|
||||
precondition: undefined,
|
||||
precondition: null,
|
||||
kbOpts: {
|
||||
kbExpr: EditorContextKeys.editorTextFocus,
|
||||
primary: KeyChord(KeyMod.CtrlCmd | KeyCode.KEY_K, KeyMod.CtrlCmd | KeyCode.US_CLOSE_SQUARE_BRACKET),
|
||||
@@ -588,7 +588,7 @@ class FoldAction extends FoldingAction<FoldingArguments> {
|
||||
id: 'editor.fold',
|
||||
label: nls.localize('foldAction.label', "Fold"),
|
||||
alias: 'Fold',
|
||||
precondition: undefined,
|
||||
precondition: null,
|
||||
kbOpts: {
|
||||
kbExpr: EditorContextKeys.editorTextFocus,
|
||||
primary: KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.US_OPEN_SQUARE_BRACKET,
|
||||
@@ -652,7 +652,7 @@ class FoldRecursivelyAction extends FoldingAction<void> {
|
||||
id: 'editor.foldRecursively',
|
||||
label: nls.localize('foldRecursivelyAction.label', "Fold Recursively"),
|
||||
alias: 'Fold Recursively',
|
||||
precondition: undefined,
|
||||
precondition: null,
|
||||
kbOpts: {
|
||||
kbExpr: EditorContextKeys.editorTextFocus,
|
||||
primary: KeyChord(KeyMod.CtrlCmd | KeyCode.KEY_K, KeyMod.CtrlCmd | KeyCode.US_OPEN_SQUARE_BRACKET),
|
||||
@@ -674,7 +674,7 @@ class FoldAllBlockCommentsAction extends FoldingAction<void> {
|
||||
id: 'editor.foldAllBlockComments',
|
||||
label: nls.localize('foldAllBlockComments.label', "Fold All Block Comments"),
|
||||
alias: 'Fold All Block Comments',
|
||||
precondition: undefined,
|
||||
precondition: null,
|
||||
kbOpts: {
|
||||
kbExpr: EditorContextKeys.editorTextFocus,
|
||||
primary: KeyChord(KeyMod.CtrlCmd | KeyCode.KEY_K, KeyMod.CtrlCmd | KeyCode.US_SLASH),
|
||||
@@ -707,7 +707,7 @@ class FoldAllRegionsAction extends FoldingAction<void> {
|
||||
id: 'editor.foldAllMarkerRegions',
|
||||
label: nls.localize('foldAllMarkerRegions.label', "Fold All Regions"),
|
||||
alias: 'Fold All Regions',
|
||||
precondition: undefined,
|
||||
precondition: null,
|
||||
kbOpts: {
|
||||
kbExpr: EditorContextKeys.editorTextFocus,
|
||||
primary: KeyChord(KeyMod.CtrlCmd | KeyCode.KEY_K, KeyMod.CtrlCmd | KeyCode.KEY_8),
|
||||
@@ -740,7 +740,7 @@ class UnfoldAllRegionsAction extends FoldingAction<void> {
|
||||
id: 'editor.unfoldAllMarkerRegions',
|
||||
label: nls.localize('unfoldAllMarkerRegions.label', "Unfold All Regions"),
|
||||
alias: 'Unfold All Regions',
|
||||
precondition: undefined,
|
||||
precondition: null,
|
||||
kbOpts: {
|
||||
kbExpr: EditorContextKeys.editorTextFocus,
|
||||
primary: KeyChord(KeyMod.CtrlCmd | KeyCode.KEY_K, KeyMod.CtrlCmd | KeyCode.KEY_9),
|
||||
@@ -773,7 +773,7 @@ class FoldAllAction extends FoldingAction<void> {
|
||||
id: 'editor.foldAll',
|
||||
label: nls.localize('foldAllAction.label', "Fold All"),
|
||||
alias: 'Fold All',
|
||||
precondition: undefined,
|
||||
precondition: null,
|
||||
kbOpts: {
|
||||
kbExpr: EditorContextKeys.editorTextFocus,
|
||||
primary: KeyChord(KeyMod.CtrlCmd | KeyCode.KEY_K, KeyMod.CtrlCmd | KeyCode.KEY_0),
|
||||
@@ -794,7 +794,7 @@ class UnfoldAllAction extends FoldingAction<void> {
|
||||
id: 'editor.unfoldAll',
|
||||
label: nls.localize('unfoldAllAction.label', "Unfold All"),
|
||||
alias: 'Unfold All',
|
||||
precondition: undefined,
|
||||
precondition: null,
|
||||
kbOpts: {
|
||||
kbExpr: EditorContextKeys.editorTextFocus,
|
||||
primary: KeyChord(KeyMod.CtrlCmd | KeyCode.KEY_K, KeyMod.CtrlCmd | KeyCode.KEY_J),
|
||||
@@ -838,7 +838,7 @@ for (let i = 1; i <= 7; i++) {
|
||||
id: FoldLevelAction.ID(i),
|
||||
label: nls.localize('foldLevelAction.label', "Fold Level {0}", i),
|
||||
alias: `Fold Level ${i}`,
|
||||
precondition: undefined,
|
||||
precondition: null,
|
||||
kbOpts: {
|
||||
kbExpr: EditorContextKeys.editorTextFocus,
|
||||
primary: KeyChord(KeyMod.CtrlCmd | KeyCode.KEY_K, KeyMod.CtrlCmd | (KeyCode.KEY_0 + i)),
|
||||
|
||||
@@ -15,7 +15,7 @@ class EditorFontZoomIn extends EditorAction {
|
||||
id: 'editor.action.fontZoomIn',
|
||||
label: nls.localize('EditorFontZoomIn.label', "Editor Font Zoom In"),
|
||||
alias: 'Editor Font Zoom In',
|
||||
precondition: undefined
|
||||
precondition: null
|
||||
});
|
||||
}
|
||||
|
||||
@@ -31,7 +31,7 @@ class EditorFontZoomOut extends EditorAction {
|
||||
id: 'editor.action.fontZoomOut',
|
||||
label: nls.localize('EditorFontZoomOut.label', "Editor Font Zoom Out"),
|
||||
alias: 'Editor Font Zoom Out',
|
||||
precondition: undefined
|
||||
precondition: null
|
||||
});
|
||||
}
|
||||
|
||||
@@ -47,7 +47,7 @@ class EditorFontZoomReset extends EditorAction {
|
||||
id: 'editor.action.fontZoomReset',
|
||||
label: nls.localize('EditorFontZoomReset.label', "Editor Font Zoom Reset"),
|
||||
alias: 'Editor Font Zoom Reset',
|
||||
precondition: undefined
|
||||
precondition: null
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -294,7 +294,7 @@ class GotoDefinitionWithMouseEditorContribution implements editorCommon.IEditorC
|
||||
|
||||
private gotoDefinition(target: IMouseTarget, sideBySide: boolean): Promise<any> {
|
||||
this.editor.setPosition(target.position!);
|
||||
const action = new DefinitionAction(new DefinitionActionConfig(sideBySide, false, true, false), { alias: '', label: '', id: '', precondition: undefined });
|
||||
const action = new DefinitionAction(new DefinitionActionConfig(sideBySide, false, true, false), { alias: '', label: '', id: '', precondition: null });
|
||||
return this.editor.invokeWithinContext(accessor => action.run(accessor, this.editor));
|
||||
}
|
||||
|
||||
|
||||
@@ -251,7 +251,7 @@ class ShowHoverAction extends EditorAction {
|
||||
]
|
||||
}, "Show Hover"),
|
||||
alias: 'Show Hover',
|
||||
precondition: undefined,
|
||||
precondition: null,
|
||||
kbOpts: {
|
||||
kbExpr: EditorContextKeys.editorTextFocus,
|
||||
primary: KeyChord(KeyMod.CtrlCmd | KeyCode.KEY_K, KeyMod.CtrlCmd | KeyCode.KEY_I),
|
||||
|
||||
@@ -40,6 +40,7 @@ import { applyCodeAction, QuickFixAction } from 'vs/editor/contrib/codeAction/co
|
||||
import { Action } from 'vs/base/common/actions';
|
||||
import { CodeActionKind } from 'vs/editor/contrib/codeAction/codeActionTrigger';
|
||||
import { IModeService } from 'vs/editor/common/services/modeService';
|
||||
import { withNullAsUndefined } from 'vs/base/common/types';
|
||||
import { IIdentifiedSingleEditOperation } from 'vs/editor/common/model';
|
||||
|
||||
const $ = dom.$;
|
||||
@@ -67,13 +68,14 @@ class ModesContentComputer implements IHoverComputer<HoverPart[]> {
|
||||
|
||||
private readonly _editor: ICodeEditor;
|
||||
private _result: HoverPart[];
|
||||
private _range?: Range;
|
||||
private _range: Range | null;
|
||||
|
||||
constructor(
|
||||
editor: ICodeEditor,
|
||||
private readonly _markerDecorationsService: IMarkerDecorationsService
|
||||
) {
|
||||
this._editor = editor;
|
||||
this._range = null;
|
||||
}
|
||||
|
||||
setRange(range: Range): void {
|
||||
@@ -181,7 +183,7 @@ class ModesContentComputer implements IHoverComputer<HoverPart[]> {
|
||||
|
||||
private _getLoadingMessage(): HoverPart {
|
||||
return {
|
||||
range: this._range,
|
||||
range: withNullAsUndefined(this._range),
|
||||
contents: [new MarkdownString().appendText(nls.localize('modesContentHover.loading', "Loading..."))]
|
||||
};
|
||||
}
|
||||
|
||||
@@ -253,7 +253,7 @@ export class IndentUsingTabs extends ChangeIndentationSizeAction {
|
||||
id: IndentUsingTabs.ID,
|
||||
label: nls.localize('indentUsingTabs', "Indent Using Tabs"),
|
||||
alias: 'Indent Using Tabs',
|
||||
precondition: undefined
|
||||
precondition: null
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -267,7 +267,7 @@ export class IndentUsingSpaces extends ChangeIndentationSizeAction {
|
||||
id: IndentUsingSpaces.ID,
|
||||
label: nls.localize('indentUsingSpaces', "Indent Using Spaces"),
|
||||
alias: 'Indent Using Spaces',
|
||||
precondition: undefined
|
||||
precondition: null
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -281,7 +281,7 @@ export class DetectIndentation extends EditorAction {
|
||||
id: DetectIndentation.ID,
|
||||
label: nls.localize('detectIndentation', "Detect Indentation from Content"),
|
||||
alias: 'Detect Indentation from Content',
|
||||
precondition: undefined
|
||||
precondition: null
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -410,7 +410,7 @@ class OpenLinkAction extends EditorAction {
|
||||
id: 'editor.action.openLink',
|
||||
label: nls.localize('label', "Open Link"),
|
||||
alias: 'Open Link',
|
||||
precondition: undefined
|
||||
precondition: null
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -35,7 +35,7 @@ export class MessageController extends Disposable implements editorCommon.IEdito
|
||||
|
||||
private readonly _editor: ICodeEditor;
|
||||
private readonly _visible: IContextKey<boolean>;
|
||||
private _messageWidget?: MessageWidget;
|
||||
private _messageWidget: MessageWidget;
|
||||
private _messageListeners: IDisposable[] = [];
|
||||
|
||||
constructor(
|
||||
@@ -96,9 +96,7 @@ export class MessageController extends Disposable implements editorCommon.IEdito
|
||||
closeMessage(): void {
|
||||
this._visible.reset();
|
||||
this._messageListeners = dispose(this._messageListeners);
|
||||
if (this._messageWidget) {
|
||||
this._messageListeners.push(MessageWidget.fadeOut(this._messageWidget));
|
||||
}
|
||||
this._messageListeners.push(MessageWidget.fadeOut(this._messageWidget));
|
||||
}
|
||||
|
||||
private _onDidAttemptReadOnlyEdit(): void {
|
||||
|
||||
@@ -34,7 +34,7 @@ export class InsertCursorAbove extends EditorAction {
|
||||
id: 'editor.action.insertCursorAbove',
|
||||
label: nls.localize('mutlicursor.insertAbove', "Add Cursor Above"),
|
||||
alias: 'Add Cursor Above',
|
||||
precondition: undefined,
|
||||
precondition: null,
|
||||
kbOpts: {
|
||||
kbExpr: EditorContextKeys.editorTextFocus,
|
||||
primary: KeyMod.CtrlCmd | KeyMod.Alt | KeyCode.UpArrow,
|
||||
@@ -83,7 +83,7 @@ export class InsertCursorBelow extends EditorAction {
|
||||
id: 'editor.action.insertCursorBelow',
|
||||
label: nls.localize('mutlicursor.insertBelow', "Add Cursor Below"),
|
||||
alias: 'Add Cursor Below',
|
||||
precondition: undefined,
|
||||
precondition: null,
|
||||
kbOpts: {
|
||||
kbExpr: EditorContextKeys.editorTextFocus,
|
||||
primary: KeyMod.CtrlCmd | KeyMod.Alt | KeyCode.DownArrow,
|
||||
@@ -132,7 +132,7 @@ class InsertCursorAtEndOfEachLineSelected extends EditorAction {
|
||||
id: 'editor.action.insertCursorAtEndOfEachLineSelected',
|
||||
label: nls.localize('mutlicursor.insertAtEndOfEachLineSelected', "Add Cursors to Line Ends"),
|
||||
alias: 'Add Cursors to Line Ends',
|
||||
precondition: undefined,
|
||||
precondition: null,
|
||||
kbOpts: {
|
||||
kbExpr: EditorContextKeys.editorTextFocus,
|
||||
primary: KeyMod.Shift | KeyMod.Alt | KeyCode.KEY_I,
|
||||
@@ -184,7 +184,7 @@ class InsertCursorAtEndOfLineSelected extends EditorAction {
|
||||
id: 'editor.action.addCursorsToBottom',
|
||||
label: nls.localize('mutlicursor.addCursorsToBottom', "Add Cursors To Bottom"),
|
||||
alias: 'Add Cursors To Bottom',
|
||||
precondition: undefined
|
||||
precondition: null
|
||||
});
|
||||
}
|
||||
|
||||
@@ -214,7 +214,7 @@ class InsertCursorAtTopOfLineSelected extends EditorAction {
|
||||
id: 'editor.action.addCursorsToTop',
|
||||
label: nls.localize('mutlicursor.addCursorsToTop', "Add Cursors To Top"),
|
||||
alias: 'Add Cursors To Top',
|
||||
precondition: undefined
|
||||
precondition: null
|
||||
});
|
||||
}
|
||||
|
||||
@@ -650,7 +650,7 @@ export class AddSelectionToNextFindMatchAction extends MultiCursorSelectionContr
|
||||
id: 'editor.action.addSelectionToNextFindMatch',
|
||||
label: nls.localize('addSelectionToNextFindMatch', "Add Selection To Next Find Match"),
|
||||
alias: 'Add Selection To Next Find Match',
|
||||
precondition: undefined,
|
||||
precondition: null,
|
||||
kbOpts: {
|
||||
kbExpr: EditorContextKeys.focus,
|
||||
primary: KeyMod.CtrlCmd | KeyCode.KEY_D,
|
||||
@@ -675,7 +675,7 @@ export class AddSelectionToPreviousFindMatchAction extends MultiCursorSelectionC
|
||||
id: 'editor.action.addSelectionToPreviousFindMatch',
|
||||
label: nls.localize('addSelectionToPreviousFindMatch', "Add Selection To Previous Find Match"),
|
||||
alias: 'Add Selection To Previous Find Match',
|
||||
precondition: undefined,
|
||||
precondition: null,
|
||||
menubarOpts: {
|
||||
menuId: MenuId.MenubarSelectionMenu,
|
||||
group: '3_multi',
|
||||
@@ -695,7 +695,7 @@ export class MoveSelectionToNextFindMatchAction extends MultiCursorSelectionCont
|
||||
id: 'editor.action.moveSelectionToNextFindMatch',
|
||||
label: nls.localize('moveSelectionToNextFindMatch', "Move Last Selection To Next Find Match"),
|
||||
alias: 'Move Last Selection To Next Find Match',
|
||||
precondition: undefined,
|
||||
precondition: null,
|
||||
kbOpts: {
|
||||
kbExpr: EditorContextKeys.focus,
|
||||
primary: KeyChord(KeyMod.CtrlCmd | KeyCode.KEY_K, KeyMod.CtrlCmd | KeyCode.KEY_D),
|
||||
@@ -714,7 +714,7 @@ export class MoveSelectionToPreviousFindMatchAction extends MultiCursorSelection
|
||||
id: 'editor.action.moveSelectionToPreviousFindMatch',
|
||||
label: nls.localize('moveSelectionToPreviousFindMatch', "Move Last Selection To Previous Find Match"),
|
||||
alias: 'Move Last Selection To Previous Find Match',
|
||||
precondition: undefined
|
||||
precondition: null
|
||||
});
|
||||
}
|
||||
protected _run(multiCursorController: MultiCursorSelectionController, findController: CommonFindController): void {
|
||||
@@ -728,7 +728,7 @@ export class SelectHighlightsAction extends MultiCursorSelectionControllerAction
|
||||
id: 'editor.action.selectHighlights',
|
||||
label: nls.localize('selectAllOccurrencesOfFindMatch', "Select All Occurrences of Find Match"),
|
||||
alias: 'Select All Occurrences of Find Match',
|
||||
precondition: undefined,
|
||||
precondition: null,
|
||||
kbOpts: {
|
||||
kbExpr: EditorContextKeys.focus,
|
||||
primary: KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.KEY_L,
|
||||
|
||||
@@ -161,7 +161,7 @@ class GrowSelectionAction extends AbstractSmartSelect {
|
||||
id: 'editor.action.smartSelect.expand',
|
||||
label: nls.localize('smartSelect.expand', "Expand Selection"),
|
||||
alias: 'Expand Selection',
|
||||
precondition: undefined,
|
||||
precondition: null,
|
||||
kbOpts: {
|
||||
kbExpr: EditorContextKeys.editorTextFocus,
|
||||
primary: KeyMod.Shift | KeyMod.Alt | KeyCode.RightArrow,
|
||||
@@ -187,7 +187,7 @@ class ShrinkSelectionAction extends AbstractSmartSelect {
|
||||
id: 'editor.action.smartSelect.shrink',
|
||||
label: nls.localize('smartSelect.shrink', "Shrink Selection"),
|
||||
alias: 'Shrink Selection',
|
||||
precondition: undefined,
|
||||
precondition: null,
|
||||
kbOpts: {
|
||||
kbExpr: EditorContextKeys.editorTextFocus,
|
||||
primary: KeyMod.Shift | KeyMod.Alt | KeyCode.LeftArrow,
|
||||
|
||||
@@ -20,7 +20,7 @@ export class ToggleTabFocusModeAction extends EditorAction {
|
||||
id: ToggleTabFocusModeAction.ID,
|
||||
label: nls.localize({ key: 'toggle.tabMovesFocus', comment: ['Turn on/off use of tab key for moving focus around VS Code'] }, "Toggle Tab Key Moves Focus"),
|
||||
alias: 'Toggle Tab Key Moves Focus',
|
||||
precondition: undefined,
|
||||
precondition: null,
|
||||
kbOpts: {
|
||||
kbExpr: null,
|
||||
primary: KeyMod.CtrlCmd | KeyCode.KEY_M,
|
||||
|
||||
@@ -14,7 +14,7 @@ class ForceRetokenizeAction extends EditorAction {
|
||||
id: 'editor.action.forceRetokenize',
|
||||
label: nls.localize('forceRetokenize', "Developer: Force Retokenize"),
|
||||
alias: 'Developer: Force Retokenize',
|
||||
precondition: undefined
|
||||
precondition: null
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -98,7 +98,7 @@ export class CursorWordStartLeft extends WordLeftCommand {
|
||||
inSelectionMode: false,
|
||||
wordNavigationType: WordNavigationType.WordStart,
|
||||
id: 'cursorWordStartLeft',
|
||||
precondition: undefined,
|
||||
precondition: null,
|
||||
kbOpts: {
|
||||
kbExpr: EditorContextKeys.textInputFocus,
|
||||
primary: KeyMod.CtrlCmd | KeyCode.LeftArrow,
|
||||
@@ -115,7 +115,7 @@ export class CursorWordEndLeft extends WordLeftCommand {
|
||||
inSelectionMode: false,
|
||||
wordNavigationType: WordNavigationType.WordEnd,
|
||||
id: 'cursorWordEndLeft',
|
||||
precondition: undefined
|
||||
precondition: null
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -126,7 +126,7 @@ export class CursorWordLeft extends WordLeftCommand {
|
||||
inSelectionMode: false,
|
||||
wordNavigationType: WordNavigationType.WordStartFast,
|
||||
id: 'cursorWordLeft',
|
||||
precondition: undefined
|
||||
precondition: null
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -137,7 +137,7 @@ export class CursorWordStartLeftSelect extends WordLeftCommand {
|
||||
inSelectionMode: true,
|
||||
wordNavigationType: WordNavigationType.WordStart,
|
||||
id: 'cursorWordStartLeftSelect',
|
||||
precondition: undefined,
|
||||
precondition: null,
|
||||
kbOpts: {
|
||||
kbExpr: EditorContextKeys.textInputFocus,
|
||||
primary: KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.LeftArrow,
|
||||
@@ -154,7 +154,7 @@ export class CursorWordEndLeftSelect extends WordLeftCommand {
|
||||
inSelectionMode: true,
|
||||
wordNavigationType: WordNavigationType.WordEnd,
|
||||
id: 'cursorWordEndLeftSelect',
|
||||
precondition: undefined
|
||||
precondition: null
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -165,7 +165,7 @@ export class CursorWordLeftSelect extends WordLeftCommand {
|
||||
inSelectionMode: true,
|
||||
wordNavigationType: WordNavigationType.WordStart,
|
||||
id: 'cursorWordLeftSelect',
|
||||
precondition: undefined
|
||||
precondition: null
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -176,7 +176,7 @@ export class CursorWordStartRight extends WordRightCommand {
|
||||
inSelectionMode: false,
|
||||
wordNavigationType: WordNavigationType.WordStart,
|
||||
id: 'cursorWordStartRight',
|
||||
precondition: undefined
|
||||
precondition: null
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -187,7 +187,7 @@ export class CursorWordEndRight extends WordRightCommand {
|
||||
inSelectionMode: false,
|
||||
wordNavigationType: WordNavigationType.WordEnd,
|
||||
id: 'cursorWordEndRight',
|
||||
precondition: undefined,
|
||||
precondition: null,
|
||||
kbOpts: {
|
||||
kbExpr: EditorContextKeys.textInputFocus,
|
||||
primary: KeyMod.CtrlCmd | KeyCode.RightArrow,
|
||||
@@ -204,7 +204,7 @@ export class CursorWordRight extends WordRightCommand {
|
||||
inSelectionMode: false,
|
||||
wordNavigationType: WordNavigationType.WordEnd,
|
||||
id: 'cursorWordRight',
|
||||
precondition: undefined
|
||||
precondition: null
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -215,7 +215,7 @@ export class CursorWordStartRightSelect extends WordRightCommand {
|
||||
inSelectionMode: true,
|
||||
wordNavigationType: WordNavigationType.WordStart,
|
||||
id: 'cursorWordStartRightSelect',
|
||||
precondition: undefined
|
||||
precondition: null
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -226,7 +226,7 @@ export class CursorWordEndRightSelect extends WordRightCommand {
|
||||
inSelectionMode: true,
|
||||
wordNavigationType: WordNavigationType.WordEnd,
|
||||
id: 'cursorWordEndRightSelect',
|
||||
precondition: undefined,
|
||||
precondition: null,
|
||||
kbOpts: {
|
||||
kbExpr: EditorContextKeys.textInputFocus,
|
||||
primary: KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.RightArrow,
|
||||
@@ -243,7 +243,7 @@ export class CursorWordRightSelect extends WordRightCommand {
|
||||
inSelectionMode: true,
|
||||
wordNavigationType: WordNavigationType.WordEnd,
|
||||
id: 'cursorWordRightSelect',
|
||||
precondition: undefined
|
||||
precondition: null
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -79,7 +79,7 @@ export class CursorWordPartLeft extends WordPartLeftCommand {
|
||||
inSelectionMode: false,
|
||||
wordNavigationType: WordNavigationType.WordStart,
|
||||
id: 'cursorWordPartLeft',
|
||||
precondition: undefined,
|
||||
precondition: null,
|
||||
kbOpts: {
|
||||
kbExpr: EditorContextKeys.textInputFocus,
|
||||
primary: 0,
|
||||
@@ -98,7 +98,7 @@ export class CursorWordPartLeftSelect extends WordPartLeftCommand {
|
||||
inSelectionMode: true,
|
||||
wordNavigationType: WordNavigationType.WordStart,
|
||||
id: 'cursorWordPartLeftSelect',
|
||||
precondition: undefined,
|
||||
precondition: null,
|
||||
kbOpts: {
|
||||
kbExpr: EditorContextKeys.textInputFocus,
|
||||
primary: 0,
|
||||
@@ -122,7 +122,7 @@ export class CursorWordPartRight extends WordPartRightCommand {
|
||||
inSelectionMode: false,
|
||||
wordNavigationType: WordNavigationType.WordEnd,
|
||||
id: 'cursorWordPartRight',
|
||||
precondition: undefined,
|
||||
precondition: null,
|
||||
kbOpts: {
|
||||
kbExpr: EditorContextKeys.textInputFocus,
|
||||
primary: 0,
|
||||
@@ -138,7 +138,7 @@ export class CursorWordPartRightSelect extends WordPartRightCommand {
|
||||
inSelectionMode: true,
|
||||
wordNavigationType: WordNavigationType.WordEnd,
|
||||
id: 'cursorWordPartRightSelect',
|
||||
precondition: undefined,
|
||||
precondition: null,
|
||||
kbOpts: {
|
||||
kbExpr: EditorContextKeys.textInputFocus,
|
||||
primary: 0,
|
||||
|
||||
Reference in New Issue
Block a user