From ceb22d0e65b9c7dce3382968cc1dfd840d477553 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 25 Jun 2025 15:42:23 +0000 Subject: [PATCH 1/4] Initial plan From d1ac93b57b71ef4b22cfd2e9d2d1f603b9b2e19f Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 25 Jun 2025 15:51:12 +0000 Subject: [PATCH 2/4] Implement reveal project in explorer command Co-authored-by: eleanorjboyd <26030610+eleanorjboyd@users.noreply.github.com> --- package.json | 15 +++++++++++++++ package.nls.json | 3 ++- src/extension.ts | 4 ++++ src/features/envCommands.ts | 10 ++++++++++ 4 files changed, 31 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 9bee47cf..19cdc318 100644 --- a/package.json +++ b/package.json @@ -255,6 +255,12 @@ "command": "python-envs.reportIssue", "title": "%python-envs.reportIssue.title%", "category": "Python Environments" + }, + { + "command": "python-envs.revealProjectInExplorer", + "title": "%python-envs.revealProjectInExplorer.title%", + "category": "Python Envs", + "icon": "$(folder-opened)" } ], "menus": { @@ -326,6 +332,10 @@ { "command": "python-envs.createAny", "when": "false" + }, + { + "command": "python-envs.revealProjectInExplorer", + "when": "false" } ], "view/item/context": [ @@ -395,6 +405,11 @@ "group": "inline", "when": "view == python-projects && viewItem =~ /.*python-workspace.*/" }, + { + "command": "python-envs.revealProjectInExplorer", + "group": "inline", + "when": "view == python-projects && viewItem =~ /.*python-workspace.*/" + }, { "command": "python-envs.uninstallPackage", "group": "inline", diff --git a/package.nls.json b/package.nls.json index ac2b4412..81b8c1cb 100644 --- a/package.nls.json +++ b/package.nls.json @@ -34,5 +34,6 @@ "python-envs.createNewProjectFromTemplate.title": "Create New Project from Template", "python-envs.terminal.activate.title": "Activate Environment in Current Terminal", "python-envs.terminal.deactivate.title": "Deactivate Environment in Current Terminal", - "python-envs.uninstallPackage.title": "Uninstall Package" + "python-envs.uninstallPackage.title": "Uninstall Package", + "python-envs.revealProjectInExplorer.title": "Reveal Project in Explorer" } diff --git a/src/extension.ts b/src/extension.ts index 94c95a05..d6c30276 100644 --- a/src/extension.ts +++ b/src/extension.ts @@ -32,6 +32,7 @@ import { refreshPackagesCommand, removeEnvironmentCommand, removePythonProject, + revealProjectInExplorer, runAsTaskCommand, runInDedicatedTerminalCommand, runInTerminalCommand, @@ -356,6 +357,9 @@ export async function activate(context: ExtensionContext): Promise { await copyPathToClipboard(item); }), + commands.registerCommand('python-envs.revealProjectInExplorer', async (item) => { + await revealProjectInExplorer(item); + }), commands.registerCommand('python-envs.terminal.activate', async () => { const terminal = activeTerminal(); if (terminal) { diff --git a/src/features/envCommands.ts b/src/features/envCommands.ts index 2aeb26f9..b46947a7 100644 --- a/src/features/envCommands.ts +++ b/src/features/envCommands.ts @@ -649,3 +649,13 @@ export async function copyPathToClipboard(item: unknown): Promise { traceVerbose(`Invalid context for copy path to clipboard: ${item}`); } } + +export async function revealProjectInExplorer(item: unknown): Promise { + if (item instanceof ProjectItem) { + const projectUri = item.project.uri; + await commands.executeCommand('revealFileInOS', projectUri); + traceInfo(`Revealed project in explorer: ${projectUri.fsPath}`); + } else { + traceVerbose(`Invalid context for reveal project in explorer: ${item}`); + } +} From 2429310572555a8a744ebf24477311334179ee5a Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 25 Jun 2025 16:02:55 +0000 Subject: [PATCH 3/4] Change reveal command to use VS Code Explorer instead of OS explorer Co-authored-by: eleanorjboyd <26030610+eleanorjboyd@users.noreply.github.com> --- src/features/envCommands.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/features/envCommands.ts b/src/features/envCommands.ts index b46947a7..14e4a04f 100644 --- a/src/features/envCommands.ts +++ b/src/features/envCommands.ts @@ -653,7 +653,7 @@ export async function copyPathToClipboard(item: unknown): Promise { export async function revealProjectInExplorer(item: unknown): Promise { if (item instanceof ProjectItem) { const projectUri = item.project.uri; - await commands.executeCommand('revealFileInOS', projectUri); + await commands.executeCommand('revealInExplorer', projectUri); traceInfo(`Revealed project in explorer: ${projectUri.fsPath}`); } else { traceVerbose(`Invalid context for reveal project in explorer: ${item}`); From 93a5369b4b618073cddc31a7c1269ed2372e12c3 Mon Sep 17 00:00:00 2001 From: eleanorjboyd <26030610+eleanorjboyd@users.noreply.github.com> Date: Wed, 25 Jun 2025 09:14:05 -0700 Subject: [PATCH 4/4] edits --- package.json | 1 - src/features/envCommands.ts | 1 - 2 files changed, 2 deletions(-) diff --git a/package.json b/package.json index 19cdc318..ef5984a3 100644 --- a/package.json +++ b/package.json @@ -407,7 +407,6 @@ }, { "command": "python-envs.revealProjectInExplorer", - "group": "inline", "when": "view == python-projects && viewItem =~ /.*python-workspace.*/" }, { diff --git a/src/features/envCommands.ts b/src/features/envCommands.ts index 14e4a04f..28cfd13f 100644 --- a/src/features/envCommands.ts +++ b/src/features/envCommands.ts @@ -654,7 +654,6 @@ export async function revealProjectInExplorer(item: unknown): Promise { if (item instanceof ProjectItem) { const projectUri = item.project.uri; await commands.executeCommand('revealInExplorer', projectUri); - traceInfo(`Revealed project in explorer: ${projectUri.fsPath}`); } else { traceVerbose(`Invalid context for reveal project in explorer: ${item}`); }