mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 18:46:40 -05:00
support default action for OE node (#22455)
* support default action for OE node * fix floating promise
This commit is contained in:
@@ -23,6 +23,7 @@ export interface IMenuItem {
|
||||
when?: ContextKeyExpression;
|
||||
group?: 'navigation' | string;
|
||||
order?: number;
|
||||
isDefault?: boolean; // {{SQL CARBON EDIT}} - Used by object explorer, indicating whether this is the action to be executed when a node is double clicked.
|
||||
}
|
||||
|
||||
export interface ISubmenuItem {
|
||||
@@ -366,6 +367,8 @@ export class MenuItemAction implements IAction {
|
||||
|
||||
readonly id: string;
|
||||
|
||||
isDefault: boolean = false; // {{SQL CARBON EDIT}}} - Add isDefault property to MenuItemAction.
|
||||
|
||||
// {{SQL CARBON EDIT}} -- remove readonly since notebook component sets these
|
||||
label: string;
|
||||
tooltip: string;
|
||||
|
||||
@@ -154,6 +154,11 @@ class Menu implements IMenu {
|
||||
? new MenuItemAction(item.command, item.alt, options, this._contextKeyService, this._commandService)
|
||||
: new SubmenuItemAction(item, this._menuService, this._contextKeyService, options);
|
||||
|
||||
// {{SQL CARBON EDIT}} - Set isDefault property
|
||||
if (isIMenuItem(item)) {
|
||||
(<MenuItemAction>action).isDefault = item.isDefault;
|
||||
}
|
||||
// {{SQL CARBON EDIT}} - End
|
||||
activeActions.push(action);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -313,6 +313,7 @@ namespace schema {
|
||||
alt?: string;
|
||||
when?: string;
|
||||
group?: string;
|
||||
isDefault?: boolean; // {{SQL CARBON EDIT}} - Used by object explorer, indicating whether this is the action to be executed when a node is double clicked.
|
||||
}
|
||||
|
||||
export interface IUserFriendlySubmenuItem {
|
||||
@@ -824,6 +825,8 @@ menusExtensionPoint.setHandler(extensions => {
|
||||
}
|
||||
|
||||
item = { command, alt, group: undefined, order: undefined, when: undefined };
|
||||
|
||||
(<IMenuItem>item).isDefault = menuItem.isDefault; // {{SQL CARBON EDIT}}} Set isDefault property.
|
||||
} else {
|
||||
if (menu.supportsSubmenus === false) {
|
||||
collector.error(localize('unsupported.submenureference', "Menu item references a submenu for a menu which doesn't have submenu support."));
|
||||
|
||||
Reference in New Issue
Block a user