From 35b09542e22a03910d066888992ab04ee5290acd Mon Sep 17 00:00:00 2001 From: Aditya Bist Date: Wed, 4 Sep 2019 15:29:27 -0700 Subject: [PATCH] removed separator from context menu (#7059) * removed separator from context menu * remove unused import --- .../browser/serverTreeActionProvider.ts | 5 +++-- .../electron-browser/scripting.contribution.ts | 14 +++++++------- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/src/sql/workbench/parts/objectExplorer/browser/serverTreeActionProvider.ts b/src/sql/workbench/parts/objectExplorer/browser/serverTreeActionProvider.ts index 57a66c784c..4aa7b8b3ce 100644 --- a/src/sql/workbench/parts/objectExplorer/browser/serverTreeActionProvider.ts +++ b/src/sql/workbench/parts/objectExplorer/browser/serverTreeActionProvider.ts @@ -26,7 +26,6 @@ import { IQueryManagementService } from 'sql/platform/query/common/queryManageme import { ServerInfoContextKey } from 'sql/workbench/parts/connection/common/serverInfoContextKey'; import { fillInActions } from 'vs/platform/actions/browser/menuEntryActionViewItem'; import { Separator } from 'vs/base/browser/ui/actionbar/actionbar'; -import { ITextResourcePropertiesService } from 'vs/editor/common/services/resourceConfiguration'; /** * Provides actions for the server tree elements @@ -107,7 +106,9 @@ export class ServerTreeActionProvider extends ContributableActionProvider { fillInActions(groups, actions, false); if (insertIndex) { - builtIn.unshift(new Separator()); + if (!(actions[insertIndex] instanceof Separator)) { + builtIn.unshift(new Separator()); + } actions.splice(insertIndex, 0, ...builtIn); } else { if (actions.length > 0) { diff --git a/src/sql/workbench/parts/scripting/electron-browser/scripting.contribution.ts b/src/sql/workbench/parts/scripting/electron-browser/scripting.contribution.ts index 1e97f6dfb2..2484002625 100644 --- a/src/sql/workbench/parts/scripting/electron-browser/scripting.contribution.ts +++ b/src/sql/workbench/parts/scripting/electron-browser/scripting.contribution.ts @@ -83,7 +83,7 @@ MenuRegistry.appendMenuItem(MenuId.DataExplorerContext, { //#region -- Object Explorer MenuRegistry.appendMenuItem(MenuId.ObjectExplorerItemContext, { - group: 'scripting', + group: '0_query', order: 1, command: { id: commands.OE_SCRIPT_AS_SELECT_COMMAND_ID, @@ -93,7 +93,7 @@ MenuRegistry.appendMenuItem(MenuId.ObjectExplorerItemContext, { }); MenuRegistry.appendMenuItem(MenuId.ObjectExplorerItemContext, { - group: 'scripting', + group: '0_query', order: 2, command: { id: commands.OE_EDIT_DATA_COMMAND_ID, @@ -103,7 +103,7 @@ MenuRegistry.appendMenuItem(MenuId.ObjectExplorerItemContext, { }); MenuRegistry.appendMenuItem(MenuId.ObjectExplorerItemContext, { - group: 'scripting', + group: '0_query', order: 3, command: { id: commands.OE_SCRIPT_AS_CREATE_COMMAND_ID, @@ -123,7 +123,7 @@ MenuRegistry.appendMenuItem(MenuId.ObjectExplorerItemContext, { }); MenuRegistry.appendMenuItem(MenuId.ObjectExplorerItemContext, { - group: 'scripting', + group: '0_query', order: 6, command: { id: commands.OE_SCRIPT_AS_EXECUTE_COMMAND_ID, @@ -133,7 +133,7 @@ MenuRegistry.appendMenuItem(MenuId.ObjectExplorerItemContext, { }); MenuRegistry.appendMenuItem(MenuId.ObjectExplorerItemContext, { - group: 'scripting', + group: '0_query', order: 5, command: { id: commands.OE_SCRIPT_AS_ALTER_COMMAND_ID, @@ -163,7 +163,7 @@ MenuRegistry.appendMenuItem(MenuId.ObjectExplorerItemContext, { }); MenuRegistry.appendMenuItem(MenuId.ObjectExplorerItemContext, { - group: 'scripting', + group: '0_query', order: 4, command: { id: commands.OE_SCRIPT_AS_DELETE_COMMAND_ID, @@ -183,7 +183,7 @@ MenuRegistry.appendMenuItem(MenuId.ObjectExplorerItemContext, { }); MenuRegistry.appendMenuItem(MenuId.ObjectExplorerItemContext, { - group: 'scripting', + group: '0_query', order: 7, command: { id: commands.OE_REFRESH_COMMAND_ID,