Skip to content
This repository was archived by the owner on Oct 23, 2025. It is now read-only.

Commit 12389de

Browse files
authored
feat: add remove environment command to project view (#216)
![image](https://github.com/user-attachments/assets/3370a0ce-44ea-48a8-8381-be190d377b72)
1 parent 1ba28ae commit 12389de

2 files changed

Lines changed: 8 additions & 0 deletions

File tree

package.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -366,6 +366,10 @@
366366
"group": "inline",
367367
"when": "view == python-projects && viewItem == python-env"
368368
},
369+
{
370+
"command": "python-envs.remove",
371+
"when": "view == python-projects && viewItem == python-env"
372+
},
369373
{
370374
"command": "python-envs.refreshPackages",
371375
"group": "inline",

src/features/envCommands.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,10 @@ export async function removeEnvironmentCommand(context: unknown, managers: Envir
171171
if (environment) {
172172
await manager?.remove(environment);
173173
}
174+
} else if (context instanceof ProjectEnvironment) {
175+
const view = context as ProjectEnvironment;
176+
const manager = managers.getEnvironmentManager(view.parent.project.uri);
177+
await manager?.remove(view.environment);
174178
} else {
175179
traceError(`Invalid context for remove command: ${context}`);
176180
}

0 commit comments

Comments
 (0)