fix: keep custom tool environments selectable

The custom Node.js and Python choices could appear unavailable until a candidate was already discovered, and selecting the source implicitly adopted the first candidate. The chooser now stays operable, waits for an explicit validated path, keeps cancellation quiet, and shows validation errors beside the affected runtime.

Candidate discovery now prioritizes active virtual environments and Conda before bounded user/system PATH and common Node/Python locations, while preserving canonical validation and deduplication.

Release note: 修复自定义 Node.js/Python 环境入口不可用的问题,并增加对 PATH、venv、Conda 和常见安装位置的解释器检测。
This commit is contained in:
mesalogo
2026-09-02 16:29:55 +08:00
parent be39665ca9
commit 4d9ab72778
12 changed files with 530 additions and 129 deletions
@@ -99,6 +99,21 @@ custom(executablePath)
这是唯一持久状态。
候选选择还具有不持久化的界面状态:
```text
closed
choosing
validating
failed
```
- 从 `closed` 进入 `choosing` 不改变当前持久来源。
- `choosing` 中不得自动采用首个候选;只有用户明确选择候选或文件后才进入 `validating`。
- 验证成功后一次性保存 `custom(executablePath)`;验证失败回到 `choosing` 并就地显示错误。
- 文件选择取消回到 `choosing`,不显示错误且不改变当前来源。
- 没有候选不是禁用“自定义环境”的理由,用户仍可刷新或选择其他可执行文件。
### 3.2 托管 Python 安装状态
```text