From d11e39cf588628e8ebd2fa7a419b11ff27842d76 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 5 Jun 2025 15:21:38 +0000 Subject: [PATCH 1/4] Initial plan for issue From 02e1694fda6b3bfced937754362cf109a409d38f Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 5 Jun 2025 15:36:37 +0000 Subject: [PATCH 2/4] Implement script file opening after creation Co-authored-by: eleanorjboyd <26030610+eleanorjboyd@users.noreply.github.com> --- src/features/envCommands.ts | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/src/features/envCommands.ts b/src/features/envCommands.ts index 24164c04..496e795c 100644 --- a/src/features/envCommands.ts +++ b/src/features/envCommands.ts @@ -22,7 +22,7 @@ import {} from '../common/errors/utils'; import { pickEnvironment } from '../common/pickers/environments'; import { pickCreator, pickEnvironmentManager, pickPackageManager } from '../common/pickers/managers'; import { pickProject, pickProjectMany } from '../common/pickers/projects'; -import { activeTextEditor, showErrorMessage, showInformationMessage } from '../common/window.apis'; +import { activeTextEditor, showErrorMessage, showInformationMessage, showTextDocument } from '../common/window.apis'; import { quoteArgs } from './execution/execUtils'; import { runAsTask } from './execution/runAsTask'; import { runInTerminal } from './terminal/runInTerminal'; @@ -434,7 +434,12 @@ export async function addPythonProjectCommand( quickCreate: true, }; } - await existingProjectsCreator.create(options); + const result = await existingProjectsCreator.create(options); + + // If the creator returns a Uri (like a script file), open it in the editor + if (result instanceof Uri) { + await showTextDocument(result); + } return; } catch (ex) { if (ex === QuickInputButtons.Back) { @@ -452,7 +457,12 @@ export async function addPythonProjectCommand( } try { - await creator.create(options); + const result = await creator.create(options); + + // If the creator returns a Uri (like a script file), open it in the editor + if (result instanceof Uri) { + await showTextDocument(result); + } } catch (ex) { if (ex === QuickInputButtons.Back) { return addPythonProjectCommand(resource, wm, em, pc); From d033b8b043670af30d57ca5f8c7d956fcb521f14 Mon Sep 17 00:00:00 2001 From: eleanorjboyd <26030610+eleanorjboyd@users.noreply.github.com> Date: Tue, 10 Jun 2025 13:25:24 -0700 Subject: [PATCH 3/4] remove additional location of opening --- src/features/envCommands.ts | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/features/envCommands.ts b/src/features/envCommands.ts index 496e795c..8c6707de 100644 --- a/src/features/envCommands.ts +++ b/src/features/envCommands.ts @@ -434,12 +434,7 @@ export async function addPythonProjectCommand( quickCreate: true, }; } - const result = await existingProjectsCreator.create(options); - - // If the creator returns a Uri (like a script file), open it in the editor - if (result instanceof Uri) { - await showTextDocument(result); - } + await existingProjectsCreator.create(options); return; } catch (ex) { if (ex === QuickInputButtons.Back) { @@ -458,7 +453,7 @@ export async function addPythonProjectCommand( try { const result = await creator.create(options); - + // If the creator returns a Uri (like a script file), open it in the editor if (result instanceof Uri) { await showTextDocument(result); From 5fb900cd556b74c75426347155426d10967ec6c1 Mon Sep 17 00:00:00 2001 From: eleanorjboyd <26030610+eleanorjboyd@users.noreply.github.com> Date: Tue, 10 Jun 2025 13:25:57 -0700 Subject: [PATCH 4/4] remove unneeded comment --- src/features/envCommands.ts | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/features/envCommands.ts b/src/features/envCommands.ts index 8c6707de..54552762 100644 --- a/src/features/envCommands.ts +++ b/src/features/envCommands.ts @@ -453,8 +453,6 @@ export async function addPythonProjectCommand( try { const result = await creator.create(options); - - // If the creator returns a Uri (like a script file), open it in the editor if (result instanceof Uri) { await showTextDocument(result); }