src/vs/platform/actions/common/menuService.ts/Menu/getActions
class Menu:	getActions(options?: IMenuActionOptions): [string, Array<MenuItemAction | SubmenuItemAction>][] {
		const result: [string, Array<MenuItemAction | SubmenuItemAction>][] = [];
		for (const group of this._menuGroups) {
			const [id, items] = group;
			const activeActions: Array<MenuItemAction | SubmenuItemAction> = [];
			for (const item of items) {
				if (this._contextKeyService.contextMatchesRules(item.when)) {
					let action: MenuItemAction | SubmenuItemAction | undefined;
					if (isIMenuItem(item)) {
						action = new MenuItemAction(item.command, item.alt, options, this._contextKeyService, this._commandService);
					} else {
						action = new SubmenuItemAction(item, this._menuService, this._contextKeyService, options);
						if (action.actions.length === 0) {
							action.dispose();
							action = undefined;
						}
					}

					if (action) {
						activeActions.push(action);
					}
				}
			}
			if (activeActions.length > 0) {
				result.push([id, activeActions]);
			}
		}
		return result;
	}