@@ -23,19 +23,19 @@ interface ISyncData {
2323@injectable ( )
2424export class InteractiveWindowProvider implements IInteractiveWindowProvider , IAsyncDisposable {
2525
26- private activeInteractiveWindow : IInteractiveWindow | undefined ;
27- private postOffice : PostOffice ;
26+ private activeInteractiveWindow : IInteractiveWindow | undefined ;
27+ private postOffice : PostOffice ;
2828 private id : string ;
29- private pendingSyncs : Map < string , ISyncData > = new Map < string , ISyncData > ( ) ;
29+ private pendingSyncs : Map < string , ISyncData > = new Map < string , ISyncData > ( ) ;
3030 private executedCode : EventEmitter < string > = new EventEmitter < string > ( ) ;
3131 private activeInteractiveWindowExecuteHandler : Disposable | undefined ;
3232 constructor (
3333 @inject ( ILiveShareApi ) liveShare : ILiveShareApi ,
3434 @inject ( IServiceContainer ) private serviceContainer : IServiceContainer ,
35- @inject ( IAsyncDisposableRegistry ) asyncRegistry : IAsyncDisposableRegistry ,
35+ @inject ( IAsyncDisposableRegistry ) asyncRegistry : IAsyncDisposableRegistry ,
3636 @inject ( IDisposableRegistry ) private disposables : IDisposableRegistry ,
3737 @inject ( IConfigurationService ) private configService : IConfigurationService
38- ) {
38+ ) {
3939 asyncRegistry . push ( this ) ;
4040
4141 // Create a post office so we can make sure interactive windows are created at the same time
@@ -53,15 +53,15 @@ export class InteractiveWindowProvider implements IInteractiveWindowProvider, IA
5353 this . id = uuid ( ) ;
5454 }
5555
56- public getActive ( ) : IInteractiveWindow | undefined {
56+ public getActive ( ) : IInteractiveWindow | undefined {
5757 return this . activeInteractiveWindow ;
5858 }
5959
60- public get onExecutedCode ( ) : Event < string > {
60+ public get onExecutedCode ( ) : Event < string > {
6161 return this . executedCode . event ;
6262 }
6363
64- public async getOrCreateActive ( ) : Promise < IInteractiveWindow > {
64+ public async getOrCreateActive ( ) : Promise < IInteractiveWindow > {
6565 if ( ! this . activeInteractiveWindow ) {
6666 await this . create ( ) ;
6767 }
@@ -77,7 +77,7 @@ export class InteractiveWindowProvider implements IInteractiveWindowProvider, IA
7777 throw new Error ( localize . DataScience . pythonInteractiveCreateFailed ( ) ) ;
7878 }
7979
80- public async getNotebookOptions ( ) : Promise < INotebookServerOptions > {
80+ public async getNotebookOptions ( ) : Promise < INotebookServerOptions > {
8181 // Find the settings that we are going to launch our server with
8282 const settings = this . configService . getSettings ( ) ;
8383 let serverURI : string | undefined = settings . datascience . jupyterServerURI ;
@@ -96,11 +96,11 @@ export class InteractiveWindowProvider implements IInteractiveWindowProvider, IA
9696 } ;
9797 }
9898
99- public dispose ( ) : Promise < void > {
99+ public dispose ( ) : Promise < void > {
100100 return this . postOffice . dispose ( ) ;
101101 }
102102
103- private async create ( ) : Promise < void > {
103+ private async create ( ) : Promise < IInteractiveWindow > {
104104 // Set it as soon as we create it. The .ctor for the interactive window
105105 // may cause a subclass to talk to the IInteractiveWindowProvider to get the active interactive window.
106106 this . activeInteractiveWindow = this . serviceContainer . get < IInteractiveWindow > ( IInteractiveWindow ) ;
@@ -110,6 +110,7 @@ export class InteractiveWindowProvider implements IInteractiveWindowProvider, IA
110110 this . activeInteractiveWindowExecuteHandler = this . activeInteractiveWindow . onExecutedCode ( this . onInteractiveWindowExecute ) ;
111111 this . disposables . push ( this . activeInteractiveWindowExecuteHandler ) ;
112112 await this . activeInteractiveWindow . ready ;
113+ return this . activeInteractiveWindow ;
113114 }
114115
115116 private onPeerCountChanged ( newCount : number ) {
@@ -162,7 +163,7 @@ export class InteractiveWindowProvider implements IInteractiveWindowProvider, IA
162163 }
163164 }
164165
165- private async synchronizeCreate ( ) : Promise < void > {
166+ private async synchronizeCreate ( ) : Promise < void > {
166167 // Create a new pending wait if necessary
167168 if ( this . postOffice . peerCount > 0 || this . postOffice . role === vsls . Role . Guest ) {
168169 const key = uuid ( ) ;
0 commit comments