Commit cae81b4
Update PET command to include submenu for find and resolve operations (#702)
This PR updates the "Python: Run Python Environment Tool (PET) in
Terminal" command to provide a better user experience by adding a
submenu that allows users to choose between different PET operations.
## Changes
### Before
The command would directly run the PET executable without any options,
requiring users to manually add arguments in the terminal.
### After
The command now presents a QuickPick menu with two options:
1. **Find All Environments** - Runs `pet find --verbose` to discover and
list all Python environments
2. **Resolve Environment...** - Prompts for a Python executable path,
then runs `pet resolve <path>` to get detailed environment information
## User Experience Flow
1. User runs "Python: Run Python Environment Tool (PET) in Terminal..."
2. A menu appears with clear descriptions of each operation:
- "Find All Environments": Finds all environments and reports them to
standard output
- "Resolve Environment...": Resolves & reports details of a specific
environment
3. For "Find All Environments": Terminal opens and immediately runs the
find command
4. For "Resolve Environment...": User enters a path to a Python
executable, then the resolve command runs
5. All interactions support cancellation and include proper error
handling
## Technical Details
- Updated command title to include ellipsis ("...") to indicate
additional user interaction
- Implemented using VS Code's native QuickPick and InputBox APIs
- Added input validation for the resolve path option
- Maintained existing terminal creation and error handling patterns
- All existing functionality preserved with no breaking changes
The implementation follows the existing codebase patterns and includes
comprehensive error handling for a smooth user experience.
Fixes #701.
<!-- START COPILOT CODING AGENT TIPS -->
---
✨ Let Copilot coding agent [set things up for
you](https://github.com/microsoft/vscode-python-environments/issues/new?title=✨Set+up+Copilot+instructions&body=Configure%20instructions%20for%20this%20repository%20as%20documented%20in%20%5BBest%20practices%20for%20Copilot%20coding%20agent%20in%20your%20repository%5D%28https://gh.io/copilot-coding-agent-tips%29%0A%0A%3COnboard%20this%20repo%3E&assignees=copilot)
— coding agent works faster and does higher quality work when set up for
your repo.
---------
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: eleanorjboyd <26030610+eleanorjboyd@users.noreply.github.com>1 parent 8afb007 commit cae81b4
2 files changed
+57
-8
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
39 | | - | |
| 39 | + | |
40 | 40 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| 12 | + | |
12 | 13 | | |
13 | 14 | | |
14 | 15 | | |
| |||
57 | 58 | | |
58 | 59 | | |
59 | 60 | | |
60 | | - | |
61 | 61 | | |
| 62 | + | |
62 | 63 | | |
63 | 64 | | |
64 | 65 | | |
| |||
241 | 242 | | |
242 | 243 | | |
243 | 244 | | |
244 | | - | |
245 | | - | |
246 | | - | |
247 | | - | |
| 245 | + | |
248 | 246 | | |
249 | 247 | | |
250 | 248 | | |
| |||
450 | 448 | | |
451 | 449 | | |
452 | 450 | | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
453 | 476 | | |
454 | 477 | | |
455 | 478 | | |
456 | 479 | | |
457 | | - | |
458 | | - | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
| 485 | + | |
| 486 | + | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
| 493 | + | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
| 499 | + | |
| 500 | + | |
| 501 | + | |
| 502 | + | |
| 503 | + | |
| 504 | + | |
| 505 | + | |
| 506 | + | |
| 507 | + | |
459 | 508 | | |
460 | 509 | | |
461 | 510 | | |
| |||
0 commit comments