remove sql kernel setting

This commit is contained in:
Chris LaFreniere
2019-02-19 17:35:33 -08:00
parent 1f501f4553
commit 02b1ba03ed
5 changed files with 9 additions and 77 deletions

View File

@@ -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,

View File

@@ -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",

View File

@@ -250,7 +250,7 @@ export class NotebookComponent extends AngularDisposable implements OnInit, OnDe
private async loadModel(): Promise<void> {
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

View File

@@ -75,11 +75,6 @@ export function getStandardKernelsForProvider(providerId: string, notebookServic
return <IStandardKernelWithProvider[]>(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 {

View File

@@ -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<INotebookManager> {
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;