@@ -22,7 +22,7 @@ import {} from '../common/errors/utils';
2222import { pickEnvironment } from '../common/pickers/environments' ;
2323import { pickCreator , pickEnvironmentManager , pickPackageManager } from '../common/pickers/managers' ;
2424import { pickProject , pickProjectMany } from '../common/pickers/projects' ;
25- import { activeTextEditor , showErrorMessage , showInformationMessage } from '../common/window.apis' ;
25+ import { activeTextEditor , showErrorMessage , showInformationMessage , showTextDocument } from '../common/window.apis' ;
2626import { quoteArgs } from './execution/execUtils' ;
2727import { runAsTask } from './execution/runAsTask' ;
2828import { runInTerminal } from './terminal/runInTerminal' ;
@@ -434,7 +434,12 @@ export async function addPythonProjectCommand(
434434 quickCreate : true ,
435435 } ;
436436 }
437- await existingProjectsCreator . create ( options ) ;
437+ const result = await existingProjectsCreator . create ( options ) ;
438+
439+ // If the creator returns a Uri (like a script file), open it in the editor
440+ if ( result instanceof Uri ) {
441+ await showTextDocument ( result ) ;
442+ }
438443 return ;
439444 } catch ( ex ) {
440445 if ( ex === QuickInputButtons . Back ) {
@@ -452,7 +457,12 @@ export async function addPythonProjectCommand(
452457 }
453458
454459 try {
455- await creator . create ( options ) ;
460+ const result = await creator . create ( options ) ;
461+
462+ // If the creator returns a Uri (like a script file), open it in the editor
463+ if ( result instanceof Uri ) {
464+ await showTextDocument ( result ) ;
465+ }
456466 } catch ( ex ) {
457467 if ( ex === QuickInputButtons . Back ) {
458468 return addPythonProjectCommand ( resource , wm , em , pc ) ;
0 commit comments