@@ -249,6 +249,13 @@ export class InteractiveEditorController implements IEditorContribution {
249
249
return State . INIT_UI ;
250
250
}
251
251
252
+ private _showWidget ( ) : void {
253
+ assertType ( this . _activeSession ) ;
254
+ const selectionRange = this . _activeSession . wholeRange . value ;
255
+ const position = this . _strategy ?. getWidgetPosition ( selectionRange ) ;
256
+ this . _zone . value . showWidget ( selectionRange , position ) ;
257
+ }
258
+
252
259
private async [ State . INIT_UI ] ( options : InteractiveEditorRunOptions | undefined ) : Promise < State . WAIT_FOR_INPUT | State . SHOW_RESPONSE | State . APPLY_RESPONSE > {
253
260
assertType ( this . _activeSession ) ;
254
261
@@ -269,8 +276,9 @@ export class InteractiveEditorController implements IEditorContribution {
269
276
this . _zone . value . widget . placeholder = this . _getPlaceholderText ( ) ;
270
277
this . _zone . value . widget . value = this . _activeSession . lastInput ?? '' ;
271
278
this . _zone . value . widget . updateInfo ( this . _activeSession . session . message ?? localize ( 'welcome.1' , "AI-generated code may be incorrect" ) ) ;
272
- this . _zone . value . show ( this . _activeSession . wholeRange . value ) ;
273
279
this . _zone . value . widget . preferredExpansionState = this . _activeSession . lastExpansionState ;
280
+ console . log ( 'before show of the init ui' ) ;
281
+ this . _showWidget ( ) ;
274
282
275
283
this . _sessionStore . add ( this . _editor . onDidChangeModel ( ( e ) => {
276
284
const msg = this . _activeSession ?. lastExchange
@@ -359,7 +367,9 @@ export class InteractiveEditorController implements IEditorContribution {
359
367
assertType ( this . _activeSession ) ;
360
368
361
369
this . _zone . value . widget . placeholder = this . _getPlaceholderText ( ) ;
362
- this . _zone . value . show ( this . _activeSession . wholeRange . value ) ;
370
+
371
+ console . log ( 'before show of wait_for_input' ) ;
372
+ this . _showWidget ( ) ;
363
373
364
374
if ( options ?. message ) {
365
375
this . _zone . value . widget . value = options ?. message ;
0 commit comments