-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
use an environment variable to select port in launch.json #18841
Comments
@int19h |
Hi there, any news about this? Thank you |
Hi @int19h @karthiknadig , is it possible to know if this is currently supported? Thank you for your time |
We don't support it currently, but it would be a simple change. In fact, I think debugpy might as well support strings for all scalar properties, to enable substitutions everywhere. |
If you point me to the right part of the code, I could submit a PR. Best |
Awesome! We have a central place where type checking & conversions are performed on JSON being parsed; the code that does the actual parsing then calls into that while specifying the types it expects to receive, and various other constraints (e.g. optional or not). I think it would be the best to tweak the type checker for numbers to allow (convertible) string values - and automatically convert them to the corresponding number before returning. This way we also get support for e.g. 64-bit integers. The relevant code is here: It just needs a branch for when validation without conversion fails, and one of the items in |
Solved in microsoft/debugpy#921 |
Similar to microsoft/vscode-java-debug#962 I would to like use an environment variable DEBUG_PORT to set the port on which the python debugger is listening.
Now it does not seem possible because the port variable in launch.json needs to be a number. If I try setting an env variable, as in the code below, I get the following error:
}
"name": "Py listen",
"type": "python",
"request": "attach",
"listen": {
"host": "localhost",
"port": "${env:DEBUG_PORT}"
}
The text was updated successfully, but these errors were encountered: