Commit d787b7b
Choose project for terminal (#1401)
Fixes #291
<img width="1224" height="286" alt="image"
src="https://github.com/user-attachments/assets/05bf5783-8f0f-4479-9b0e-e838ccc85aa2"
/>
This pull request updates the logic for creating terminal commands
related to Python environments, focusing on how Python projects are
retrieved and passed to the `pickProject` function. The changes improve
consistency and clarity in how project lists are handled.
**Improvements to project selection logic:**
* The list of Python projects is now retrieved once and reused in both
the undefined context and tree item context branches, ensuring
consistency and avoiding redundant API calls.
[[1]](diffhunk://#diff-aed4c8c8194da21783959fe3536c5b86f48d4c0755e2ef4092501dbc5e849419L609-R611)
[[2]](diffhunk://#diff-aed4c8c8194da21783959fe3536c5b86f48d4c0755e2ef4092501dbc5e849419L644-R645)
* The condition for prompting the user to pick a project has been
updated to check if the list of Python projects is non-empty, which
prevents unnecessary prompts when there are no projects available.
---------
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>1 parent fcb5149 commit d787b7b
1 file changed
+5
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
33 | | - | |
34 | 33 | | |
35 | 34 | | |
36 | 35 | | |
| |||
606 | 605 | | |
607 | 606 | | |
608 | 607 | | |
609 | | - | |
610 | | - | |
| 608 | + | |
| 609 | + | |
| 610 | + | |
| 611 | + | |
611 | 612 | | |
612 | 613 | | |
613 | 614 | | |
| |||
641 | 642 | | |
642 | 643 | | |
643 | 644 | | |
644 | | - | |
| 645 | + | |
645 | 646 | | |
646 | 647 | | |
647 | 648 | | |
| |||
0 commit comments