diff --git a/extensions/notebook/package.json b/extensions/notebook/package.json index d1538e9bfe..899835e876 100644 --- a/extensions/notebook/package.json +++ b/extensions/notebook/package.json @@ -22,11 +22,6 @@ "default": "", "description": "%notebook.pythonPath.description%" }, - "notebook.sqlKernelEnabled": { - "type": "boolean", - "default": false, - "description": "%notebook.sqlKernelEnabled.description%" - }, "notebook.overrideEditorTheming": { "type": "boolean", "default": true, diff --git a/extensions/notebook/package.nls.json b/extensions/notebook/package.nls.json index 83e6df9a17..d2f1f7d042 100644 --- a/extensions/notebook/package.nls.json +++ b/extensions/notebook/package.nls.json @@ -3,7 +3,6 @@ "description": "Defines the Data-procotol based Notebook contribution and many Notebook commands and contributions.", "notebook.configuration.title": "Notebook configuration", "notebook.pythonPath.description": "Local path to python installation used by Notebooks.", - "notebook.sqlKernelEnabled.description": "Enable SQL kernel in Notebook editor (Preview). Requires reloading this window to take effect", "notebook.overrideEditorTheming.description": "Override editor default settings in the Notebook editor. Settings include background color, current line color and border", "notebook.maxTableRows.description": "Maximum number of rows returned per table in the Notebook editor", "notebook.command.new": "New Notebook", diff --git a/src/sql/parts/notebook/notebook.component.ts b/src/sql/parts/notebook/notebook.component.ts index 19a0636ef0..461d163b87 100644 --- a/src/sql/parts/notebook/notebook.component.ts +++ b/src/sql/parts/notebook/notebook.component.ts @@ -250,7 +250,7 @@ export class NotebookComponent extends AngularDisposable implements OnInit, OnDe private async loadModel(): Promise { await this.awaitNonDefaultProvider(); - let providerId = notebookUtils.sqlNotebooksEnabled(this.contextKeyService) ? 'sql' : this._notebookParams.providers.find(provider => provider !== DEFAULT_NOTEBOOK_PROVIDER); // this is tricky; really should also depend on the connection profile + let providerId = 'sql'; // this is tricky; really should also depend on the connection profile this.setContextKeyServiceWithProviderId(providerId); this.fillInActionsForCurrentContext(); for (let providerId of this._notebookParams.providers) { @@ -265,7 +265,7 @@ export class NotebookComponent extends AngularDisposable implements OnInit, OnDe notebookManagers: this.notebookManagers, standardKernels: this._notebookParams.input.standardKernels, cellMagicMapper: new CellMagicMapper(this.notebookService.languageMagics), - providerId: notebookUtils.sqlNotebooksEnabled(this.contextKeyService) ? 'sql' : 'jupyter', // this is tricky; really should also depend on the connection profile + providerId: 'sql', // this is tricky; really should also depend on the connection profile defaultKernel: this._notebookParams.input.defaultKernel, layoutChanged: this._notebookParams.input.layoutChanged, capabilitiesService: this.capabilitiesService diff --git a/src/sql/parts/notebook/notebookUtils.ts b/src/sql/parts/notebook/notebookUtils.ts index cbc8be4959..1109ee51b9 100644 --- a/src/sql/parts/notebook/notebookUtils.ts +++ b/src/sql/parts/notebook/notebookUtils.ts @@ -75,11 +75,6 @@ export function getStandardKernelsForProvider(providerId: string, notebookServic return (standardKernels); } -// Feature flag to enable Sql Notebook experience -export function sqlNotebooksEnabled(contextKeyService: IContextKeyService) { - return contextKeyService.contextMatchesRules(ContextKeyExpr.equals('config.notebook.sqlKernelEnabled', true)); -} - // In the Attach To dropdown, show the database name (if it exists) using the current connection // Example: myFakeServer (myDatabase) export function formatServerNameWithDatabaseNameForAttachTo(connectionProfile: ConnectionProfile): string { diff --git a/src/sql/workbench/services/notebook/common/notebookServiceImpl.ts b/src/sql/workbench/services/notebook/common/notebookServiceImpl.ts index 029db808bf..68424a0678 100644 --- a/src/sql/workbench/services/notebook/common/notebookServiceImpl.ts +++ b/src/sql/workbench/services/notebook/common/notebookServiceImpl.ts @@ -29,7 +29,6 @@ import { getIdFromLocalExtensionId } from 'vs/platform/extensionManagement/commo import { Deferred } from 'sql/base/common/promise'; import { SqlSessionManager } from 'sql/workbench/services/notebook/common/sqlSessionManager'; import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; -import { sqlNotebooksEnabled } from 'sql/parts/notebook/notebookUtils'; import { IContextKeyService, IContextKey } from 'vs/platform/contextkey/common/contextkey'; import { NotebookEditorVisibleContext } from 'sql/workbench/services/notebook/common/notebookContext'; import { IEditorService } from 'vs/workbench/services/editor/common/editorService'; @@ -422,23 +421,13 @@ export class NotebookService extends Disposable implements INotebookService { } private registerBuiltInProvider() { - if (!sqlNotebooksEnabled(this._contextKeyService)) { - let defaultProvider = new BuiltinProvider(); - this.registerProvider(defaultProvider.providerId, defaultProvider); - notebookRegistry.registerNotebookProvider({ - provider: defaultProvider.providerId, - fileExtensions: DEFAULT_NOTEBOOK_FILETYPE, - standardKernels: { name: noKernel, connectionProviderIds: [] } - }); - } else { - let sqlProvider = new SqlNotebookProvider(this._instantiationService); - this.registerProvider(sqlProvider.providerId, sqlProvider); - notebookRegistry.registerNotebookProvider({ - provider: sqlProvider.providerId, - fileExtensions: DEFAULT_NOTEBOOK_FILETYPE, - standardKernels: { name: 'SQL', connectionProviderIds: ['MSSQL'] } - }); - } + let sqlProvider = new SqlNotebookProvider(this._instantiationService); + this.registerProvider(sqlProvider.providerId, sqlProvider); + notebookRegistry.registerNotebookProvider({ + provider: sqlProvider.providerId, + fileExtensions: DEFAULT_NOTEBOOK_FILETYPE, + standardKernels: { name: 'SQL', connectionProviderIds: ['MSSQL'] } + }); } private removeContributedProvidersFromCache(identifier: IExtensionIdentifier, extensionService: IExtensionService) { @@ -453,52 +442,6 @@ export class NotebookService extends Disposable implements INotebookService { } } -export class BuiltinProvider implements INotebookProvider { - private manager: BuiltInNotebookManager; - - constructor() { - this.manager = new BuiltInNotebookManager(); - } - - public get providerId(): string { - return DEFAULT_NOTEBOOK_PROVIDER; - } - - getNotebookManager(notebookUri: URI): Thenable { - return Promise.resolve(this.manager); - } - handleNotebookClosed(notebookUri: URI): void { - // No-op - } -} - -export class BuiltInNotebookManager implements INotebookManager { - private _contentManager: nb.ContentManager; - private _sessionManager: nb.SessionManager; - - constructor() { - this._contentManager = new LocalContentManager(); - this._sessionManager = new SessionManager(); - } - - public get providerId(): string { - return DEFAULT_NOTEBOOK_PROVIDER; - } - - public get contentManager(): nb.ContentManager { - return this._contentManager; - } - - public get serverManager(): nb.ServerManager { - return undefined; - } - - public get sessionManager(): nb.SessionManager { - return this._sessionManager; - } - -} - export class SqlNotebookProvider implements INotebookProvider { private manager: SqlNotebookManager;