You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Convert all non-string configuration properties in debug #115
The attach debug configurations expect a number as port number rather than a string. This prevents variable substitution in launch.json. As an example, the following configuration raises an error on the port key: Incorrect type. Expected "number".
Assume that you have to debug your application by attaching to a running process. Assume that you package and debug the application into a container by attaching VSCode to the running container. Finally, assume that you have to debug parallel instances of the application on your local machine. In this scenario each debugger must use a distinct port (this is the case for containers in a podman pod at least because they share the same network). The port could be supplied as an environment variable to each container.
Thanks for the feature request! We are going to give the community 60 days from when this issue was created to provide 7 👍 upvotes on the opening comment to gauge general interest in this idea. If there's enough upvotes then we will consider this feature request in our future planning. If there's unfortunately not enough upvotes then we will close this issue.
Note that we already did this for processId before, and for the same exact reason.
Given that it's the second property like that, and that it's hard to predict all the scenarios in which variable substitution might be useful for one property or another, I feel like this should be generalized to all numeric properties. On debugpy side this would be easy, since there's a common path for all typed property queries. However, connect.port for attach is a separate thing, because it's handled entirely by vscode-python.
Thank you to everyone who upvoted this issue! Since the community showed interest in this feature request we will leave this issue open as something to consider implementing at some point in the future.
We do encourage people to continue 👍 the first/opening comment as it helps us prioritize our work based on what the community seems to want the most.
I found this issue as I was preparing to make the exact same feature request! I have a situation where a team of developers needs to actively debug multiple containerized micro-services at once. This works just fine, but the caveat is that that everyone has to modify their local launch.json file to hard code their various debug ports. Obviously, those changes can't be checked into source control without causing tons of useless and contentious changes. Having the ability to specify these ports via environment variables would be much cleaner and less error prone! I really hope this story gets worked; if I knew how/where to make the change I would be willing to pitch in. Alas, I am a poor excuse for a TypeScript developer.
18441 handled this case for the listen configuration only. I can't speculate on the how/why of that, but I know for sure that the connect configuration will only accept an integer for port, at least as of VS Code 1.71.1 and Python Extension 2022.14.0. I get the following when I try:
Activity
karthiknadig commentedon Nov 18, 2021
Thanks for the feature request! We are going to give the community 60 days from when this issue was created to provide 7 👍 upvotes on the opening comment to gauge general interest in this idea. If there's enough upvotes then we will consider this feature request in our future planning. If there's unfortunately not enough upvotes then we will close this issue.
karthiknadig commentedon Nov 18, 2021
/cc Pavel Minaev (@int19h)
int19h commentedon Nov 18, 2021
Note that we already did this for
processIdbefore, and for the same exact reason.Given that it's the second property like that, and that it's hard to predict all the scenarios in which variable substitution might be useful for one property or another, I feel like this should be generalized to all numeric properties. On debugpy side this would be easy, since there's a common path for all typed property queries. However,
connect.portfor attach is a separate thing, because it's handled entirely by vscode-python.brettcannon commentedon Feb 3, 2022
Thank you to everyone who upvoted this issue! Since the community showed interest in this feature request we will leave this issue open as something to consider implementing at some point in the future.
We do encourage people to continue 👍 the first/opening comment as it helps us prioritize our work based on what the community seems to want the most.
dyohn commentedon Sep 13, 2022
I found this issue as I was preparing to make the exact same feature request! I have a situation where a team of developers needs to actively debug multiple containerized micro-services at once. This works just fine, but the caveat is that that everyone has to modify their local
launch.jsonfile to hard code their various debug ports. Obviously, those changes can't be checked into source control without causing tons of useless and contentious changes. Having the ability to specify these ports via environment variables would be much cleaner and less error prone! I really hope this story gets worked; if I knew how/where to make the change I would be willing to pitch in. Alas, I am a poor excuse for a TypeScript developer.TheDouglasMann commentedon Sep 13, 2022
Definitely need this!
int19h commentedon Sep 26, 2022
Isn't this a dupe of microsoft/vscode-python#18841?
dyohn commentedon Sep 26, 2022
18441 handled this case for the
listenconfiguration only. I can't speculate on the how/why of that, but I know for sure that theconnectconfiguration will only accept an integer for port, at least as of VS Code 1.71.1 and Python Extension 2022.14.0. I get the following when I try:14 remaining items
andreamah commentedon Nov 28, 2023
Are there short verif steps for this feature?
rzhao271 commentedon Nov 29, 2023
I still can't specify the port as a string in a Python attach launch configuration, so it looks like the original request still isn't fixed.
paulacamargo25 commentedon Nov 29, 2023
This issue was solved in the Python Debugger Extension.
Please use the
"type": "debugpy"for the configuration.rzhao271 commentedon Nov 29, 2023
LGTM. Thanks!