mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 18:46:40 -05:00
Vscode merge (#4582)
* Merge from vscode 37cb23d3dd4f9433d56d4ba5ea3203580719a0bd * fix issues with merges * bump node version in azpipe * replace license headers * remove duplicate launch task * fix build errors * fix build errors * fix tslint issues * working through package and linux build issues * more work * wip * fix packaged builds * working through linux build errors * wip * wip * wip * fix mac and linux file limits * iterate linux pipeline * disable editor typing * revert series to parallel * remove optimize vscode from linux * fix linting issues * revert testing change * add work round for new node * readd packaging for extensions * fix issue with angular not resolving decorator dependencies
This commit is contained in:
@@ -76,7 +76,7 @@ class AlternativeKeyEmitter extends Emitter<boolean> {
|
||||
}
|
||||
}
|
||||
|
||||
export function fillInContextMenuActions(menu: IMenu, options: IMenuActionOptions, target: IAction[] | { primary: IAction[]; secondary: IAction[]; }, contextMenuService: IContextMenuService, isPrimaryGroup?: (group: string) => boolean): void {
|
||||
export function fillInContextMenuActions(menu: IMenu, options: IMenuActionOptions | undefined, target: IAction[] | { primary: IAction[]; secondary: IAction[]; }, contextMenuService: IContextMenuService, isPrimaryGroup?: (group: string) => boolean): void {
|
||||
const groups = menu.getActions(options);
|
||||
const getAlternativeActions = AlternativeKeyEmitter.getInstance(contextMenuService).isPressed;
|
||||
|
||||
|
||||
@@ -6,9 +6,9 @@
|
||||
import { Action } from 'vs/base/common/actions';
|
||||
import { SyncDescriptor0, createSyncDescriptor } from 'vs/platform/instantiation/common/descriptors';
|
||||
import { IConstructorSignature2, createDecorator } from 'vs/platform/instantiation/common/instantiation';
|
||||
import { IKeybindings } from 'vs/platform/keybinding/common/keybindingsRegistry';
|
||||
import { IKeybindings, KeybindingsRegistry } from 'vs/platform/keybinding/common/keybindingsRegistry';
|
||||
import { ContextKeyExpr, IContextKeyService } from 'vs/platform/contextkey/common/contextkey';
|
||||
import { ICommandService } from 'vs/platform/commands/common/commands';
|
||||
import { ICommandService, ICommandHandler, CommandsRegistry } from 'vs/platform/commands/common/commands';
|
||||
import { IDisposable } from 'vs/base/common/lifecycle';
|
||||
import { Event, Emitter } from 'vs/base/common/event';
|
||||
import { URI, UriComponents } from 'vs/base/common/uri';
|
||||
@@ -65,6 +65,7 @@ export const enum MenuId {
|
||||
DebugConsoleContext,
|
||||
DebugVariablesContext,
|
||||
DebugWatchContext,
|
||||
DebugToolbar,
|
||||
EditorContext,
|
||||
EditorTitle,
|
||||
EditorTitleContext,
|
||||
@@ -284,13 +285,13 @@ export class SyncActionDescriptor {
|
||||
private _descriptor: SyncDescriptor0<Action>;
|
||||
|
||||
private _id: string;
|
||||
private _label: string;
|
||||
private _label?: string;
|
||||
private _keybindings: IKeybindings | undefined;
|
||||
private _keybindingContext: ContextKeyExpr | undefined;
|
||||
private _keybindingWeight: number | undefined;
|
||||
|
||||
constructor(ctor: IConstructorSignature2<string, string, Action>,
|
||||
id: string, label: string, keybindings?: IKeybindings, keybindingContext?: ContextKeyExpr, keybindingWeight?: number
|
||||
id: string, label: string | undefined, keybindings?: IKeybindings, keybindingContext?: ContextKeyExpr, keybindingWeight?: number
|
||||
) {
|
||||
this._id = id;
|
||||
this._label = label;
|
||||
@@ -308,7 +309,7 @@ export class SyncActionDescriptor {
|
||||
return this._id;
|
||||
}
|
||||
|
||||
public get label(): string {
|
||||
public get label(): string | undefined {
|
||||
return this._label;
|
||||
}
|
||||
|
||||
@@ -324,3 +325,63 @@ export class SyncActionDescriptor {
|
||||
return this._keybindingWeight;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
export interface IActionDescriptor {
|
||||
id: string;
|
||||
handler: ICommandHandler;
|
||||
|
||||
// ICommandUI
|
||||
title?: ILocalizedString;
|
||||
category?: string;
|
||||
f1?: boolean;
|
||||
|
||||
//
|
||||
menu?: {
|
||||
menuId: MenuId,
|
||||
when?: ContextKeyExpr;
|
||||
group?: string;
|
||||
};
|
||||
|
||||
//
|
||||
keybinding?: {
|
||||
when?: ContextKeyExpr;
|
||||
weight?: number;
|
||||
keys: IKeybindings;
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
export function registerAction(desc: IActionDescriptor) {
|
||||
|
||||
const { id, handler, title, category, menu, keybinding } = desc;
|
||||
|
||||
// 1) register as command
|
||||
CommandsRegistry.registerCommand(id, handler);
|
||||
|
||||
// 2) menus
|
||||
if (menu && title) {
|
||||
let command = { id, title, category };
|
||||
let { menuId, when, group } = menu;
|
||||
MenuRegistry.appendMenuItem(menuId, {
|
||||
command,
|
||||
when,
|
||||
group
|
||||
});
|
||||
}
|
||||
|
||||
// 3) keybindings
|
||||
if (keybinding) {
|
||||
let { when, weight, keys } = keybinding;
|
||||
KeybindingsRegistry.registerKeybindingRule({
|
||||
id,
|
||||
when,
|
||||
weight: weight || 0,
|
||||
primary: keys.primary,
|
||||
secondary: keys.secondary,
|
||||
linux: keys.linux,
|
||||
mac: keys.mac,
|
||||
win: keys.win
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user