mirror of
https://github.com/zed-industries/zed.git
synced 2026-10-19 11:04:06 +00:00
Closes #52912 ## Context The Python debug adapter listed `envFile` in its schema (defaulting to `${ZED_WORKTREE_ROOT}/.env`) but never read it. Debugpy only accepts `env` as a key-value object — `envFile` is a VS Code extension concept that Zed needs to handle itself, same as the Go adapter already does for Delve. ## Changes Added `handle_envs` to `crates/dap_adapters/src/python.rs`: - Reads `envFile` (string or array), parses with `dotenvy`, merges into `env` - Explicit `env` values win on conflict with `envFile` - Strips `envFile` before the config reaches debugpy - Called after `cwd` is resolved so relative paths work Two `FakeFs` tests cover the happy path and the conflict case. No `Cargo.toml` changes needed. ## Usage ```json [{ "label": "Debug main.py", "adapter": "Debugpy", "request": "launch", "program": "${ZED_FILE}", "envFile": "${ZED_WORKTREE_ROOT}/.env" }] ``` ## Before <img width="1512" height="954" alt="before" src="https://github.com/user-attachments/assets/0b6c6353-fdac-4f09-a424-2e9651a08912" /> ## After <img width="1512" height="947" alt="after" src="https://github.com/user-attachments/assets/8f354a5e-7ac7-432b-8293-3571fecf263b" /> Release Notes: - Fixed `envFile` not being loaded when debugging Python projects with debugpy --------- Co-authored-by: Piotr Osiewicz <24362066+osiewicz@users.noreply.github.com> |
||
|---|---|---|
| .. | ||
| src | ||
| Cargo.toml | ||
| LICENSE-GPL | ||