Respect envFile property in debugpy for VSCode launch configuration - #52127
Open
nick-lehmann wants to merge 3 commits into
Open
Respect envFile property in debugpy for VSCode launch configuration#52127nick-lehmann wants to merge 3 commits into
nick-lehmann wants to merge 3 commits into
Conversation
|
We require contributors to sign our Contributor License Agreement, and we don't have @nick-lehmann on file. You can sign our CLA at https://zed.dev/cla. Once you've signed, post a comment here that says '@cla-bot check'. |
zed-codeowner-coordinator
Bot
requested review from
a team,
Anthony-Eid and
kubkon
and removed request for
a team
March 22, 2026 11:56
Author
|
@cla-bot check |
|
The cla-bot has been summoned, and re-checked this pull request! |
nick-lehmann
force-pushed
the
dap-env-file
branch
from
March 22, 2026 12:04
0d38d5e to
da2f7f4
Compare
Contributor
nick-lehmann
force-pushed
the
dap-env-file
branch
from
May 10, 2026 13:19
da2f7f4 to
0823f51
Compare
Author
|
@kubkon I am terribly sorry for the delay. I fixed the small issue that let the tests fail. I hope this PR is now ready. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Context
The adapter for
debugpydoes not respect theenvFileattribute in VSCode launch configuration.#32984 describes the same missing behavior for Delve adapter for Go. The corresponding PR #33666 implemented a change where the location of the
envFilewas resolved and environment variables are injected both in theenvof the DAP launch request and the process environment that launches Delve.This workaround is necessary as Delve, debuypy and other DAP adapters do not support the
envFileproperty.However, this PR only implemented this for Delve and therefore only for Go. When I tried to start a debugging session for a VSCode-style python launch configuration, I ran into issues because the environment variables where missing.
This PR factors out the functionality for handling the
envFileand uses it across the Delve and Debugpy implementation.I considered implementing it for all other debuggers as well, but refrained from doing so to keep my first contribution small. If desired, I would implement it for the other debuggers as well.
If you wish for me to create an issue first for traceability, please tell me.
How to Review
I have created a small reproduction repository with a sample Python application. The
main.pyfile simply reads theNAMEenv variable and prints it to stdout. It contains a.envfile with said env variable. The launch configuration wires everything together.https://github.com/nick-lehmann/zed-python-debug-repro
With the latest version of Zed, the debug configuration will yield "Hello nobody", as the
NAMEenv variable is not provided to debugpy. With the changes in this branch, the debug configuration will correctly yield "Hello nick".Self-Review Checklist
Release Notes:
envFileattribute in VSCode style launch configuration for python