diff --git a/src/sql/workbench/parts/scripting/browser/scripting.contribution.ts b/src/sql/workbench/parts/scripting/browser/scripting.contribution.ts index d6cbc09728..b114036dad 100644 --- a/src/sql/workbench/parts/scripting/browser/scripting.contribution.ts +++ b/src/sql/workbench/parts/scripting/browser/scripting.contribution.ts @@ -26,7 +26,7 @@ MenuRegistry.appendMenuItem(MenuId.DataExplorerContext, { id: commands.SCRIPT_AS_CREATE_COMMAND_ID, title: localize('scriptAsCreate', "Script as Create") }, - when: MssqlNodeContext.CanScriptAsCreateOrDelete + when: ContextKeyExpr.and(MssqlNodeContext.CanScriptAsCreateOrDelete, MssqlNodeContext.EngineEdition.notEqualsTo(DatabaseEngineEdition.SqlOnDemand.toString())) }); // Script as Delete @@ -117,8 +117,8 @@ MenuRegistry.appendMenuItem(MenuId.ObjectExplorerItemContext, { when: ContextKeyExpr.or( ContextKeyExpr.and(TreeNodeContextKey.NodeType.isEqualTo('Table'), MssqlNodeContext.EngineEdition.notEqualsTo(DatabaseEngineEdition.SqlOnDemand.toString())), ContextKeyExpr.and(TreeNodeContextKey.NodeType.isEqualTo('View'), MssqlNodeContext.EngineEdition.notEqualsTo(DatabaseEngineEdition.SqlOnDemand.toString())), - TreeNodeContextKey.NodeType.isEqualTo('Schema'), - TreeNodeContextKey.NodeType.isEqualTo('User'), + ContextKeyExpr.and(TreeNodeContextKey.NodeType.isEqualTo('Schema'), MssqlNodeContext.EngineEdition.notEqualsTo(DatabaseEngineEdition.SqlOnDemand.toString())), + ContextKeyExpr.and(TreeNodeContextKey.NodeType.isEqualTo('User'), MssqlNodeContext.EngineEdition.notEqualsTo(DatabaseEngineEdition.SqlOnDemand.toString())), TreeNodeContextKey.NodeType.isEqualTo('UserDefinedTableType'), TreeNodeContextKey.NodeType.isEqualTo('StoredProcedure'), TreeNodeContextKey.NodeType.isEqualTo('AggregateFunction'), @@ -236,7 +236,7 @@ MenuRegistry.appendMenuItem(MenuId.ExplorerWidgetContext, { id: ExplorerEditDataActionID, title: EditDataAction.LABEL }, - when: ItemContextKey.ItemType.isEqualTo('table'), + when: ContextKeyExpr.and(ItemContextKey.ItemType.isEqualTo('table'), MssqlNodeContext.EngineEdition.notEqualsTo(DatabaseEngineEdition.SqlOnDemand.toString())), order: 2 }); @@ -296,6 +296,7 @@ MenuRegistry.appendMenuItem(MenuId.ExplorerWidgetContext, { id: commands.ExplorerScriptCreateAction.ID, title: commands.ExplorerScriptCreateAction.LABEL }, + when: MssqlNodeContext.EngineEdition.notEqualsTo(DatabaseEngineEdition.SqlOnDemand.toString()), order: 2 }); //#endregion