diff --git a/src/sql/parts/dashboard/common/dashboardPage.component.ts b/src/sql/parts/dashboard/common/dashboardPage.component.ts index 1e092655b2..ab7895aeba 100644 --- a/src/sql/parts/dashboard/common/dashboardPage.component.ts +++ b/src/sql/parts/dashboard/common/dashboardPage.component.ts @@ -31,7 +31,7 @@ import * as nls from 'vs/nls'; import * as objects from 'vs/base/common/objects'; import { Event, Emitter } from 'vs/base/common/event'; import { Action } from 'vs/base/common/actions'; -import { ConfigurationTarget } from 'vs/platform/configuration/common/configuration'; +import { ConfigurationTarget, IConfigurationService } from 'vs/platform/configuration/common/configuration'; import Severity from 'vs/base/common/severity'; import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; import { INotificationService } from 'vs/platform/notification/common/notification'; @@ -96,7 +96,8 @@ export abstract class DashboardPage extends AngularDisposable implements IConfig @Inject(forwardRef(() => ChangeDetectorRef)) protected _cd: ChangeDetectorRef, @Inject(IInstantiationService) private instantiationService: IInstantiationService, @Inject(INotificationService) private notificationService: INotificationService, - @Inject(IAngularEventingService) private angularEventingService: IAngularEventingService + @Inject(IAngularEventingService) private angularEventingService: IAngularEventingService, + @Inject(IConfigurationService) private configurationService: IConfigurationService ) { super(); } @@ -138,6 +139,12 @@ export abstract class DashboardPage extends AngularDisposable implements IConfig // Before separating tabs into pinned / shown, ensure that the home tab is always set up as expected allTabs = this.setAndRemoveHomeTab(allTabs, homeWidgets); + // If preview features are disabled only show the home tab + let extensionTabsEnabled = this.configurationService.getValue('workbench')['enablePreviewFeatures']; + if (!extensionTabsEnabled) { + allTabs = []; + } + // Load tab setting configs this._tabSettingConfigs = this.dashboardService.getSettings>([this.context, 'tabs'].join('.')); @@ -164,9 +171,13 @@ export abstract class DashboardPage extends AngularDisposable implements IConfig // Set panel actions let openedTabs = [...pinnedDashboardTabs, ...alwaysShowTabs]; - let addNewTabAction = this.instantiationService.createInstance(AddFeatureTabAction, allTabs, openedTabs, this.dashboardService.getUnderlyingUri()); - this._tabsDispose.push(addNewTabAction); - this.panelActions = [addNewTabAction]; + if (extensionTabsEnabled) { + let addNewTabAction = this.instantiationService.createInstance(AddFeatureTabAction, allTabs, openedTabs, this.dashboardService.getUnderlyingUri()); + this._tabsDispose.push(addNewTabAction); + this.panelActions = [addNewTabAction]; + } else { + this.panelActions = []; + } this._cd.detectChanges(); this._tabsDispose.push(this.dashboardService.onPinUnpinTab(e => { diff --git a/src/sql/parts/dashboard/pages/databaseDashboardPage.component.ts b/src/sql/parts/dashboard/pages/databaseDashboardPage.component.ts index 5622087be1..595babe78e 100644 --- a/src/sql/parts/dashboard/pages/databaseDashboardPage.component.ts +++ b/src/sql/parts/dashboard/pages/databaseDashboardPage.component.ts @@ -18,6 +18,7 @@ import * as nls from 'vs/nls'; import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; import { INotificationService } from 'vs/platform/notification/common/notification'; import { IContextKeyService } from 'vs/platform/contextkey/common/contextkey'; +import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; export class DatabaseDashboardPage extends DashboardPage implements OnInit { protected propertiesWidget: WidgetConfig = { @@ -43,9 +44,10 @@ export class DatabaseDashboardPage extends DashboardPage implements OnInit { @Inject(forwardRef(() => ElementRef)) el: ElementRef, @Inject(IInstantiationService) instantiationService: IInstantiationService, @Inject(INotificationService) notificationService: INotificationService, - @Inject(IAngularEventingService) angularEventingService: IAngularEventingService + @Inject(IAngularEventingService) angularEventingService: IAngularEventingService, + @Inject(IConfigurationService) configurationService: IConfigurationService ) { - super(dashboardService, el, _cd, instantiationService, notificationService, angularEventingService); + super(dashboardService, el, _cd, instantiationService, notificationService, angularEventingService, configurationService); this._register(dashboardService.onUpdatePage(() => { this.refresh(true); this._cd.detectChanges(); diff --git a/src/sql/parts/dashboard/pages/serverDashboardPage.component.ts b/src/sql/parts/dashboard/pages/serverDashboardPage.component.ts index 5e204ce348..d35e2947cd 100644 --- a/src/sql/parts/dashboard/pages/serverDashboardPage.component.ts +++ b/src/sql/parts/dashboard/pages/serverDashboardPage.component.ts @@ -18,6 +18,7 @@ import * as nls from 'vs/nls'; import { INotificationService } from 'vs/platform/notification/common/notification'; import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; import { IContextKeyService } from 'vs/platform/contextkey/common/contextkey'; +import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; export class ServerDashboardPage extends DashboardPage implements OnInit { protected propertiesWidget: WidgetConfig = { @@ -44,9 +45,10 @@ export class ServerDashboardPage extends DashboardPage implements OnInit { @Inject(forwardRef(() => ElementRef)) el: ElementRef, @Inject(IInstantiationService) instantiationService: IInstantiationService, @Inject(INotificationService) notificationService: INotificationService, - @Inject(IAngularEventingService) angularEventingService: IAngularEventingService + @Inject(IAngularEventingService) angularEventingService: IAngularEventingService, + @Inject(IConfigurationService) configurationService: IConfigurationService ) { - super(dashboardService, el, _cd, instantiationService, notificationService, angularEventingService); + super(dashboardService, el, _cd, instantiationService, notificationService, angularEventingService, configurationService); // revert back to default database this._letDashboardPromise = this.dashboardService.connectionManagementService.changeDatabase('master'); } diff --git a/src/sql/parts/grid/views/editData/editData.component.ts b/src/sql/parts/grid/views/editData/editData.component.ts index ae1fc8d3f4..9f95e2f79e 100644 --- a/src/sql/parts/grid/views/editData/editData.component.ts +++ b/src/sql/parts/grid/views/editData/editData.component.ts @@ -88,7 +88,7 @@ export class EditDataComponent extends GridParentComponent implements OnInit, On @Inject(forwardRef(() => ChangeDetectorRef)) cd: ChangeDetectorRef, @Inject(IBootstrapParams) params: IEditDataComponentParams, @Inject(IInstantiationService) private instantiationService: IInstantiationService, - @Inject(INotificationService) private notificationService: INotificationService, + @Inject(INotificationService) notificationService: INotificationService, @Inject(IContextMenuService) contextMenuService: IContextMenuService, @Inject(IKeybindingService) keybindingService: IKeybindingService, @Inject(IContextKeyService) contextKeyService: IContextKeyService, @@ -96,7 +96,7 @@ export class EditDataComponent extends GridParentComponent implements OnInit, On @Inject(IClipboardService) clipboardService: IClipboardService, @Inject(IQueryEditorService) queryEditorService: IQueryEditorService ) { - super(el, cd, contextMenuService, keybindingService, contextKeyService, configurationService, clipboardService, queryEditorService); + super(el, cd, contextMenuService, keybindingService, contextKeyService, configurationService, clipboardService, queryEditorService, notificationService); this._el.nativeElement.className = 'slickgridContainer'; this.dataService = params.dataService; this.actionProvider = this.instantiationService.createInstance(EditDataGridActionProvider, this.dataService, this.onGridSelectAll(), this.onDeleteRow(), this.onRevertRow()); diff --git a/src/sql/parts/grid/views/gridParentComponent.ts b/src/sql/parts/grid/views/gridParentComponent.ts index ccbe79ae34..596ccc67bd 100644 --- a/src/sql/parts/grid/views/gridParentComponent.ts +++ b/src/sql/parts/grid/views/gridParentComponent.ts @@ -37,6 +37,7 @@ import { IDisposable, dispose } from 'vs/base/common/lifecycle'; import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; import { IClipboardService } from 'vs/platform/clipboard/common/clipboardService'; import { StandardKeyboardEvent } from 'vs/base/browser/keyboardEvent'; +import { INotificationService } from 'vs/platform/notification/common/notification'; export abstract class GridParentComponent { // CONSTANTS @@ -100,7 +101,8 @@ export abstract class GridParentComponent { protected contextKeyService: IContextKeyService, protected configurationService: IConfigurationService, protected clipboardService: IClipboardService, - protected queryEditorService: IQueryEditorService + protected queryEditorService: IQueryEditorService, + protected notificationService: INotificationService ) { this.toDispose = []; } diff --git a/src/sql/parts/grid/views/query/query.component.ts b/src/sql/parts/grid/views/query/query.component.ts index 9fb39739f6..b20606c921 100644 --- a/src/sql/parts/grid/views/query/query.component.ts +++ b/src/sql/parts/grid/views/query/query.component.ts @@ -42,6 +42,8 @@ import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding'; import { IContextKeyService } from 'vs/platform/contextkey/common/contextkey'; import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; import { IClipboardService } from 'vs/platform/clipboard/common/clipboardService'; +import { INotificationService } from 'vs/platform/notification/common/notification'; +import { localize } from 'vs/nls'; export const QUERY_SELECTOR: string = 'query-component'; @@ -126,7 +128,9 @@ export class QueryComponent extends GridParentComponent implements OnInit, OnDes } }, { - showCondition: () => { return true; }, + showCondition: () => { + return this.configurationService.getValue('workbench')['enablePreviewFeatures']; + }, icon: () => { return 'viewChart'; }, hoverText: () => { return LocalizedConstants.viewChartLabel; }, functionality: (batchId, resultId, index) => { @@ -187,9 +191,10 @@ export class QueryComponent extends GridParentComponent implements OnInit, OnDes @Inject(IContextKeyService) contextKeyService: IContextKeyService, @Inject(IConfigurationService) configurationService: IConfigurationService, @Inject(IClipboardService) clipboardService: IClipboardService, - @Inject(IQueryEditorService) queryEditorService: IQueryEditorService + @Inject(IQueryEditorService) queryEditorService: IQueryEditorService, + @Inject(INotificationService) notificationService: INotificationService, ) { - super(el, cd, contextMenuService, keybindingService, contextKeyService, configurationService, clipboardService, queryEditorService); + super(el, cd, contextMenuService, keybindingService, contextKeyService, configurationService, clipboardService, queryEditorService, notificationService); this._el.nativeElement.className = 'slickgridContainer'; this.rowHeight = configurationService.getValue('resultsGrid').rowHeight; configurationService.onDidChangeConfiguration(e => { diff --git a/src/sql/parts/query/editor/queryEditor.ts b/src/sql/parts/query/editor/queryEditor.ts index 062dbc2ecc..b80ce060a2 100644 --- a/src/sql/parts/query/editor/queryEditor.ts +++ b/src/sql/parts/query/editor/queryEditor.ts @@ -44,6 +44,7 @@ import { IQueryModelService } from 'sql/parts/query/execution/queryModel'; import { IEditorDescriptorService } from 'sql/parts/query/editor/editorDescriptorService'; import { IConnectionManagementService } from 'sql/parts/connection/common/connectionManagement'; import { attachEditableDropdownStyler } from 'sql/common/theme/styler'; +import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; import { CancellationToken } from 'vs/base/common/cancellation'; import { ICodeEditor } from 'vs/editor/browser/editorBrowser'; @@ -96,7 +97,8 @@ export class QueryEditor extends BaseEditor { @IQueryModelService private _queryModelService: IQueryModelService, @IEditorDescriptorService private _editorDescriptorService: IEditorDescriptorService, @IContextKeyService contextKeyService: IContextKeyService, - @IConnectionManagementService private _connectionManagementService: IConnectionManagementService + @IConnectionManagementService private _connectionManagementService: IConnectionManagementService, + @IConfigurationService private _configurationService: IConfigurationService ) { super(QueryEditor.ID, _telemetryService, themeService); @@ -446,6 +448,16 @@ export class QueryEditor extends BaseEditor { this._estimatedQueryPlanAction = this._instantiationService.createInstance(EstimatedQueryPlanAction, this); this._actualQueryPlanAction = this._instantiationService.createInstance(ActualQueryPlanAction, this); + this.setTaskbarContent(); + + this._configurationService.onDidChangeConfiguration(e => { + if (e.affectedKeys.includes('workbench.enablePreviewFeatures')) { + this.setTaskbarContent(); + } + }); + } + + private setTaskbarContent(): void { // Create HTML Elements for the taskbar let separator = Taskbar.createTaskbarSeparator(); @@ -460,6 +472,13 @@ export class QueryEditor extends BaseEditor { { element: separator }, { action: this._estimatedQueryPlanAction } ]; + + // Remove the estimated query plan action if preview features are not enabled + let previewFeaturesEnabled = this._configurationService.getValue('workbench')['enablePreviewFeatures']; + if (!previewFeaturesEnabled) { + content = content.slice(0, -2); + } + this._taskbar.setContent(content); } diff --git a/src/sql/parts/query/views/queryOutput.component.ts b/src/sql/parts/query/views/queryOutput.component.ts index 6c3a4e2b03..7ce155be3f 100644 --- a/src/sql/parts/query/views/queryOutput.component.ts +++ b/src/sql/parts/query/views/queryOutput.component.ts @@ -22,6 +22,7 @@ import { PanelComponent, IPanelOptions } from 'sql/base/browser/ui/panel/panel.c import * as nls from 'vs/nls'; import { IDisposable } from 'vs/base/common/lifecycle'; +import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; export const QUERY_OUTPUT_SELECTOR: string = 'query-output-component'; @@ -66,7 +67,8 @@ export class QueryOutputComponent implements OnDestroy { constructor( @Inject(forwardRef(() => ElementRef)) el: ElementRef, @Inject(forwardRef(() => ChangeDetectorRef)) private _cd: ChangeDetectorRef, - @Inject(IBootstrapParams) public queryParameters: IQueryComponentParams + @Inject(IBootstrapParams) public queryParameters: IQueryComponentParams, + @Inject(IConfigurationService) private _configurationService: IConfigurationService ) { } @@ -75,12 +77,14 @@ export class QueryOutputComponent implements OnDestroy { */ public ngAfterViewInit(): void { this._disposables.push(toDisposableSubscription(this.queryComponent.queryPlanAvailable.subscribe((xml) => { - this.hasQueryPlan = true; - this._cd.detectChanges(); - this._panel.selectTab(this.topOperationsTabIdentifier); - this.topOperationsComponent.planXml = xml; - this._panel.selectTab(this.queryPlanTabIdentifier); - this.queryPlanComponent.planXml = xml; + if (this._configurationService.getValue('workbench')['enablePreviewFeatures']) { + this.hasQueryPlan = true; + this._cd.detectChanges(); + this._panel.selectTab(this.topOperationsTabIdentifier); + this.topOperationsComponent.planXml = xml; + this._panel.selectTab(this.queryPlanTabIdentifier); + this.queryPlanComponent.planXml = xml; + } }))); this._disposables.push(toDisposableSubscription(this.queryComponent.showChartRequested.subscribe((dataSet) => { diff --git a/src/sql/workbench/common/actions.contribution.ts b/src/sql/workbench/common/actions.contribution.ts index 17ca6290a8..8fbe28ff43 100644 --- a/src/sql/workbench/common/actions.contribution.ts +++ b/src/sql/workbench/common/actions.contribution.ts @@ -14,6 +14,7 @@ import { IWorkbenchActionRegistry, Extensions as ActionExtensions } from 'vs/wor import { IWorkbenchContributionsRegistry, Extensions as WorkbenchExtensions } from 'vs/workbench/common/contributions'; import { ShowCurrentReleaseNotesAction } from 'sql/workbench/update/releaseNotes'; import { LifecyclePhase } from 'vs/platform/lifecycle/common/lifecycle'; +import { IConfigurationRegistry, Extensions as ConfigExtensions } from 'vs/platform/configuration/common/configurationRegistry'; new Actions.BackupAction().registerTask(false); new Actions.RestoreAction().registerTask(false); @@ -23,3 +24,16 @@ new Actions.ConfigureDashboardAction().registerTask(); // add product update and release notes contributions Registry.as(ActionExtensions.WorkbenchActions) .registerWorkbenchAction(new SyncActionDescriptor(ShowCurrentReleaseNotesAction, ShowCurrentReleaseNotesAction.ID, ShowCurrentReleaseNotesAction.LABEL), 'Show Getting Started'); + +Registry.as(ConfigExtensions.Configuration).registerConfiguration({ + 'id': 'previewFeatures', + 'title': nls.localize('previewFeatures.configTitle', 'Preview Features'), + 'type': 'object', + 'properties': { + 'workbench.enablePreviewFeatures': { + 'type': 'boolean', + 'default': undefined, + 'description': nls.localize('previewFeatures.configEnable', 'Enable unreleased preview features') + } + } +}); diff --git a/src/sql/workbench/common/actions.ts b/src/sql/workbench/common/actions.ts index 2acd0c4851..b8b3ca41e9 100644 --- a/src/sql/workbench/common/actions.ts +++ b/src/sql/workbench/common/actions.ts @@ -27,6 +27,8 @@ import { IWindowsService } from 'vs/platform/windows/common/windows'; import * as nls from 'vs/nls'; import { IEditorService } from 'vs/workbench/services/editor/common/editorService'; import { ServicesAccessor } from 'vs/platform/instantiation/common/instantiation'; +import { IWorkspaceConfigurationService } from 'vs/workbench/services/configuration/common/configuration'; +import { INotificationService } from 'vs/platform/notification/common/notification'; export interface BaseActionContext { object?: ObjectMetadata; @@ -300,6 +302,14 @@ export class BackupAction extends Task { } runTask(accessor: ServicesAccessor, profile: IConnectionProfile): TPromise { + let configurationService = accessor.get(IWorkspaceConfigurationService); + let previewFeaturesEnabled: boolean = configurationService.getValue('workbench')['enablePreviewFeatures']; + if (!previewFeaturesEnabled) { + return new TPromise((resolve, reject) => { + accessor.get(INotificationService).info(nls.localize('backup.isPreviewFeature', 'You must enable preview features in order to use backup')); + }); + } + return new TPromise((resolve, reject) => { TaskUtilities.showBackup( profile, @@ -331,6 +341,14 @@ export class RestoreAction extends Task { } runTask(accessor: ServicesAccessor, profile: IConnectionProfile): TPromise { + let configurationService = accessor.get(IWorkspaceConfigurationService); + let previewFeaturesEnabled: boolean = configurationService.getValue('workbench')['enablePreviewFeatures']; + if (!previewFeaturesEnabled) { + return new TPromise((resolve, reject) => { + accessor.get(INotificationService).info(nls.localize('restore.isPreviewFeature', 'You must enable preview features in order to use restore')); + }); + } + return new TPromise((resolve, reject) => { TaskUtilities.showRestore( profile, diff --git a/src/sql/workbench/electron-browser/enablePreviewFeatures.ts b/src/sql/workbench/electron-browser/enablePreviewFeatures.ts new file mode 100644 index 0000000000..ff8ce68309 --- /dev/null +++ b/src/sql/workbench/electron-browser/enablePreviewFeatures.ts @@ -0,0 +1,70 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the Source EULA. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +'use strict'; + +import { IWorkbenchContribution } from 'vs/workbench/common/contributions'; +import { IStorageService } from 'vs/platform/storage/common/storage'; +import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; +import { IOpenerService } from 'vs/platform/opener/common/opener'; +import { INotificationService, Severity } from 'vs/platform/notification/common/notification'; +import { localize } from 'vs/nls'; +import { onUnexpectedError } from 'vs/base/common/errors'; +import { IWindowService, IWindowsService } from 'vs/platform/windows/common/windows'; +import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; + +export class EnablePreviewFeatures implements IWorkbenchContribution { + + private static ENABLE_PREVIEW_FEATURES_SHOWN = 'workbench.enablePreviewFeaturesShown'; + + constructor( + @IStorageService storageService: IStorageService, + @IOpenerService openerService: IOpenerService, + @INotificationService notificationService: INotificationService, + @IWindowService windowService: IWindowService, + @IWindowsService windowsService: IWindowsService, + @ITelemetryService telemetryService: ITelemetryService, + @IConfigurationService configurationService: IConfigurationService + ) { + let previewFeaturesEnabled = configurationService.getValue('workbench')['enablePreviewFeatures']; + if (previewFeaturesEnabled || storageService.get(EnablePreviewFeatures.ENABLE_PREVIEW_FEATURES_SHOWN)) { + return; + } + Promise.all([ + windowService.isFocused(), + windowsService.getWindowCount() + ]).then(([focused, count]) => { + if (!focused && count > 1) { + return null; + } + configurationService.updateValue('workbench.enablePreviewFeatures', false); + + const enablePreviewFeaturesNotice = localize('enablePreviewFeatures.notice', "Would you like to enable preview features?"); + notificationService.prompt( + Severity.Info, + enablePreviewFeaturesNotice, + [{ + label: localize('enablePreviewFeatures.yes', "Yes"), + run: () => { + configurationService.updateValue('workbench.enablePreviewFeatures', true); + storageService.store(EnablePreviewFeatures.ENABLE_PREVIEW_FEATURES_SHOWN, true); + } + }, { + label: localize('enablePreviewFeatures.no', "No"), + run: () => { + configurationService.updateValue('workbench.enablePreviewFeatures', false); + } + }, { + label: localize('enablePreviewFeatures.never', "No, don't show again"), + run: () => { + configurationService.updateValue('workbench.enablePreviewFeatures', false); + storageService.store(EnablePreviewFeatures.ENABLE_PREVIEW_FEATURES_SHOWN, true); + }, + isSecondary: true + }] + ); + }) + .then(null, onUnexpectedError); + } +} diff --git a/src/sqltest/parts/query/editor/queryEditor.test.ts b/src/sqltest/parts/query/editor/queryEditor.test.ts index 8cc7bb961d..f75c5caac1 100644 --- a/src/sqltest/parts/query/editor/queryEditor.test.ts +++ b/src/sqltest/parts/query/editor/queryEditor.test.ts @@ -6,7 +6,6 @@ 'use strict'; import { InstantiationService } from 'vs/platform/instantiation/common/instantiationService'; -import { EditorInput } from 'vs/workbench/common/editor'; import { IEditorDescriptor } from 'vs/workbench/browser/editor'; import { TPromise } from 'vs/base/common/winjs.base'; import URI from 'vs/base/common/uri'; @@ -30,8 +29,9 @@ import * as TypeMoq from 'typemoq'; import * as assert from 'assert'; import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; import { BaseEditor } from 'vs/workbench/browser/parts/editor/baseEditor'; -import { INotification, INotificationService } from 'vs/platform/notification/common/notification'; +import { INotificationService } from 'vs/platform/notification/common/notification'; import { TestNotificationService } from 'vs/platform/notification/test/common/testNotificationService'; +import { ConfigurationService } from 'vs/platform/configuration/node/configurationService'; suite('SQL QueryEditor Tests', () => { let queryModelService: QueryModelService; @@ -40,6 +40,7 @@ suite('SQL QueryEditor Tests', () => { let notificationService: TypeMoq.Mock; let editorDescriptorService: TypeMoq.Mock; let connectionManagementService: TypeMoq.Mock; + let configurationService: TypeMoq.Mock; let memento: TypeMoq.Mock; let queryInput: QueryInput; @@ -57,7 +58,8 @@ suite('SQL QueryEditor Tests', () => { undefined, editorDescriptorService.object, undefined, - undefined); + undefined, + configurationService.object); }; setup(() => { @@ -134,6 +136,14 @@ suite('SQL QueryEditor Tests', () => { // Create a QueryModelService queryModelService = new QueryModelService(instantiationService.object, notificationService.object); + + configurationService = TypeMoq.Mock.ofInstance({ + getValue: () => undefined, + onDidChangeConfiguration: () => undefined + } as any); + configurationService.setup(x => x.getValue(TypeMoq.It.isAny())).returns(() => { + return { enablePreviewFeatures: true }; + }); }); test('createEditor creates only the taskbar', (done) => { diff --git a/src/vs/workbench/parts/welcome/gettingStarted/electron-browser/gettingStarted.contribution.ts b/src/vs/workbench/parts/welcome/gettingStarted/electron-browser/gettingStarted.contribution.ts index fcf2632b54..c5777679be 100644 --- a/src/vs/workbench/parts/welcome/gettingStarted/electron-browser/gettingStarted.contribution.ts +++ b/src/vs/workbench/parts/welcome/gettingStarted/electron-browser/gettingStarted.contribution.ts @@ -9,6 +9,8 @@ import { GettingStarted } from './gettingStarted'; import { TelemetryOptOut } from './telemetryOptOut'; import { IWorkbenchContributionsRegistry, Extensions as WorkbenchExtensions } from 'vs/workbench/common/contributions'; import { LifecyclePhase } from 'vs/platform/lifecycle/common/lifecycle'; +// {{SQL CARBON EDIT}} - Add preview feature switch +import { EnablePreviewFeatures } from 'sql/workbench/electron-browser/enablePreviewFeatures'; // {{SQL CARBON EDIT}} // Registry @@ -22,3 +24,8 @@ Registry Registry .as(WorkbenchExtensions.Workbench) .registerWorkbenchContribution(TelemetryOptOut, LifecyclePhase.Eventually); + +// {{SQL CARBON EDIT}} - Add preview feature switch +Registry + .as(WorkbenchExtensions.Workbench) + .registerWorkbenchContribution(EnablePreviewFeatures, LifecyclePhase.Eventually);