diff --git a/extensions/mssql/package.json b/extensions/mssql/package.json index a509b6b62e..62e2be7d76 100644 --- a/extensions/mssql/package.json +++ b/extensions/mssql/package.json @@ -474,7 +474,7 @@ "notebook/toolbar": [ { "command": "mssql.exportNotebookToSql", - "when": "providerId == sql" + "when": "config.workbench.enablePreviewFeatures && providerId == sql" } ] }, diff --git a/src/sql/workbench/contrib/query/browser/queryEditor.ts b/src/sql/workbench/contrib/query/browser/queryEditor.ts index b9b12cc487..05162a6de3 100644 --- a/src/sql/workbench/contrib/query/browser/queryEditor.ts +++ b/src/sql/workbench/contrib/query/browser/queryEditor.ts @@ -256,26 +256,31 @@ export class QueryEditor extends BaseEditor { private setTaskbarContent(): void { // Create HTML Elements for the taskbar - let separator = Taskbar.createTaskbarSeparator(); - - // Set the content in the order we desire - let content: ITaskbarContent[] = [ - { action: this._runQueryAction }, - { action: this._cancelQueryAction }, - { element: separator }, - { action: this._toggleConnectDatabaseAction }, - { action: this._changeConnectionAction }, - { action: this._listDatabasesAction }, - { element: separator }, - { action: this._estimatedQueryPlanAction }, - { action: this._toggleSqlcmdMode }, - { action: this._exportAsNotebookAction } - ]; - - // Remove the estimated query plan action if preview features are not enabled - let previewFeaturesEnabled = this.configurationService.getValue('workbench')['enablePreviewFeatures']; - if (!previewFeaturesEnabled) { - content.splice(7, 1); + const separator = Taskbar.createTaskbarSeparator(); + let content: ITaskbarContent[]; + const previewFeaturesEnabled = this.configurationService.getValue('workbench')['enablePreviewFeatures']; + if (previewFeaturesEnabled) { + content = [ + { action: this._runQueryAction }, + { action: this._cancelQueryAction }, + { element: separator }, + { action: this._toggleConnectDatabaseAction }, + { action: this._changeConnectionAction }, + { action: this._listDatabasesAction }, + { element: separator }, + { action: this._estimatedQueryPlanAction }, // Preview + { action: this._toggleSqlcmdMode }, // Preview + { action: this._exportAsNotebookAction } // Preview + ]; + } else { + content = [ + { action: this._runQueryAction }, + { action: this._cancelQueryAction }, + { element: separator }, + { action: this._toggleConnectDatabaseAction }, + { action: this._changeConnectionAction }, + { action: this._listDatabasesAction } + ]; } this.taskbar.setContent(content);