Fix #4047 Redesign notebook model to handle single client session (#4371)

* Start single client session based on the default kernel or saved kernel in NB.

* Added kernel displayName to standardKernel.
Modified name to allign wtih Juptyer Kernel.name.
So we can show the displayName during startup and use the name to start the session.

* Change session.OnSessionReady event in KernelDropDown

* Added model.KernelChnaged for switching kernel in the same provider

* Fixed session.Ready sequence

* Fixed merge issues

* Solve merged issue

* Fixed wrong kernel name in saved NB

* Added new event in Model to notify kernel change.
Toolbar depends on ModelReady to load

* Change attachTo to wait for ModelReady like KenelDropDown

* sanitizeSavedKernelInfo to fix invalid kernel and display_name. For example: PySpark1111 and PySpark 1111


* Added _contextsChangingEmitter to change loadContext msg when changing kernel

* Resolve PR comments
This commit is contained in:
Yurong He
2019-03-11 17:59:13 -07:00
committed by GitHub
parent b44d2b1bb3
commit 118d2c7273
20 changed files with 425 additions and 313 deletions

View File

@@ -175,6 +175,7 @@ export class NotebookService extends Disposable implements INotebookService {
if (provider) {
this._providerToStandardKernels.set(notebookConstants.SQL, [{
name: notebookConstants.SQL,
displayName: notebookConstants.SQL,
connectionProviderIds: sqlConnectionTypes
}]);
}
@@ -451,7 +452,7 @@ export class NotebookService extends Disposable implements INotebookService {
notebookRegistry.registerNotebookProvider({
provider: sqlProvider.providerId,
fileExtensions: DEFAULT_NOTEBOOK_FILETYPE,
standardKernels: { name: 'SQL', connectionProviderIds: ['MSSQL'] }
standardKernels: { name: notebookConstants.SQL, displayName: notebookConstants.SQL, connectionProviderIds: [notebookConstants.SQL_CONNECTION_PROVIDER] }
});
}