Notebooks: Adding Change Kernel API, 3 Integration Tests (#5287)

* Notebook change kernel

* Fix notifying of k change too many times add tests

* Fix broken unit test

* Deal with comment
This commit is contained in:
Chris LaFreniere
2019-06-03 14:49:40 -07:00
committed by GitHub
parent 4b6214c9a4
commit 8d70544374
10 changed files with 130 additions and 17 deletions

View File

@@ -264,8 +264,11 @@ export class ClientSession implements IClientSession {
private async updateCachedKernelSpec(): Promise<void> {
this._cachedKernelSpec = undefined;
let kernel = this.kernel;
if (kernel && kernel.isReady) {
this._cachedKernelSpec = await this.kernel.getSpec();
if (kernel) {
await kernel.ready;
if (kernel.isReady) {
this._cachedKernelSpec = await kernel.getSpec();
}
}
}

View File

@@ -332,6 +332,11 @@ export interface INotebookModel {
*/
readonly contentChanged: Event<NotebookContentChange>;
/**
* Event fired on notebook provider change
*/
readonly onProviderIdChange: Event<string>;
/**
* The trusted mode of the Notebook
*/

View File

@@ -457,10 +457,6 @@ export class NotebookModel extends Disposable implements INotebookModel {
}
}
this._onClientSessionReady.fire(clientSession);
this._kernelChangedEmitter.fire({
oldValue: undefined,
newValue: clientSession.kernel
});
}
}