mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-15 10:58:31 -05:00
remove sql kernel setting
This commit is contained in:
@@ -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,
|
||||
|
||||
@@ -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",
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user