Implement Session support through the extension host (#3228)

Full plumb through of Session support. Also fixed some test issues

- Load session and get necessary information in kernels list
- Run Cell button now works as expected
- Added a ToggleAction base class which can be used for anything that switches icons. I'd still prefer to have this be dynamic and as clean as the extension classes
- Fixed account test unhandled promise rejections (caused by incorrect / invalid tests) that made it hard to see all the test run output.
This commit is contained in:
Kevin Cunnane
2018-11-16 10:35:03 -08:00
committed by GitHub
parent f3525cc555
commit 90dc788893
23 changed files with 939 additions and 212 deletions

View File

@@ -10,7 +10,7 @@ import { Event, Emitter } from 'vs/base/common/event';
import URI from 'vs/base/common/uri';
import { nb } from 'sqlops';
import { ICellModelOptions, IModelFactory } from './modelInterfaces';
import { ICellModelOptions, IModelFactory, FutureInternal } from './modelInterfaces';
import * as notebookUtils from '../notebookUtils';
import { CellTypes, CellType, NotebookChangeType } from 'sql/parts/notebook/models/contracts';
import { ICellModel } from 'sql/parts/notebook/models/modelInterfaces';
@@ -24,7 +24,7 @@ export class CellModel implements ICellModel {
private _cellType: nb.CellType;
private _source: string;
private _language: string;
private _future: nb.IFuture;
private _future: FutureInternal;
private _outputs: nb.ICellOutput[] = [];
private _isEditMode: boolean;
private _onOutputsChanged = new Emitter<ReadonlyArray<nb.ICellOutput>>();
@@ -69,7 +69,7 @@ export class CellModel implements ICellModel {
return this._isEditMode;
}
public get future(): nb.IFuture {
public get future(): FutureInternal {
return this._future;
}
@@ -137,7 +137,7 @@ export class CellModel implements ICellModel {
* Sets the future which will be used to update the output
* area for this cell
*/
setFuture(future: nb.IFuture): void {
setFuture(future: FutureInternal): void {
if (this._future === future) {
// Nothing to do
return;

View File

@@ -299,7 +299,7 @@ export class ClientSession implements IClientSession {
public async shutdown(): Promise<void> {
// Always try to shut down session
if (this._session && this._session.id) {
this.notebookManager.sessionManager.shutdown(this._session.id);
await this.notebookManager.sessionManager.shutdown(this._session.id);
}
let serverManager = this.notebookManager.serverManager;
if (serverManager) {

View File

@@ -338,10 +338,16 @@ export interface ICellModel {
cellType: CellType;
trustedMode: boolean;
active: boolean;
readonly future: FutureInternal;
readonly outputs: ReadonlyArray<nb.ICellOutput>;
readonly onOutputsChanged: Event<ReadonlyArray<nb.ICellOutput>>;
setFuture(future: FutureInternal): void;
equals(cellModel: ICellModel): boolean;
toJSON(): nb.ICell;
onOutputsChanged: Event<ReadonlyArray<nb.ICellOutput>>;
}
export interface FutureInternal extends nb.IFuture {
inProgress: boolean;
}
export interface IModelFactory {