@@ -91,6 +91,12 @@ export class Setup
9191 private readonly getExpShowError : ( ) => string | undefined
9292 private readonly collectWorkspaceScale : ( ) => Promise < WorkspaceScale >
9393
94+ private readonly setupRun : EventEmitter < void > = this . dispose . track (
95+ new EventEmitter < void > ( )
96+ )
97+
98+ private readonly onDidRunSetup : Event < void > = this . setupRun . event
99+
94100 private readonly workspaceChanged : EventEmitter < void > = this . dispose . track (
95101 new EventEmitter ( )
96102 )
@@ -131,8 +137,17 @@ export class Setup
131137
132138 this . status = status
133139
134- this . initialize = initialize
135- this . resetMembers = resetMembers
140+ this . initialize = async ( ) => {
141+ const result = initialize ( )
142+ await experiments . isReady ( )
143+ this . setupRun . fire ( )
144+ return result
145+ }
146+ this . resetMembers = ( ) => {
147+ const result = resetMembers ( )
148+ this . setupRun . fire ( )
149+ return result
150+ }
136151
137152 this . collectWorkspaceScale = collectWorkspaceScale
138153
@@ -148,15 +163,9 @@ export class Setup
148163 this . getHasData = ( ) => experiments . getHasData ( )
149164 this . getExpShowError = ( ) => experiments . getCliError ( )
150165 const onDidChangeHasData = experiments . columnsChanged . event
151- this . dispose . track (
152- onDidChangeHasData ( ( ) =>
153- Promise . all ( [
154- this . sendDataToWebview ( ) ,
155- setContextValue ( ContextKey . PROJECT_HAS_DATA , this . getHasData ( ) )
156- ] )
157- )
158- )
166+ this . dispose . track ( onDidChangeHasData ( ( ) => this . updateProjectHasData ( ) ) )
159167
168+ this . watchSetupRun ( )
160169 this . dispose . track ( this . onDidChangeWorkspace ( ( ) => run ( this ) ) )
161170 this . watchForVenvChanges ( )
162171 this . watchConfigurationDetailsForChanges ( )
@@ -729,6 +738,23 @@ export class Setup
729738 }
730739 }
731740
741+ private watchSetupRun ( ) {
742+ const onDidRunSetup = this . setupRun . event
743+ this . dispose . track (
744+ onDidRunSetup ( ( ) => {
745+ this . deferred . resolve ( )
746+ return this . updateProjectHasData ( )
747+ } )
748+ )
749+ }
750+
751+ private updateProjectHasData ( ) {
752+ return Promise . all ( [
753+ this . sendDataToWebview ( ) ,
754+ setContextValue ( ContextKey . PROJECT_HAS_DATA , this . getHasData ( ) )
755+ ] )
756+ }
757+
732758 private async setStudioValues ( ) {
733759 const cwd = this . getCwd ( )
734760
0 commit comments