-
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
Consider adopting the proposed Port Attributes API #21292
Comments
Python folks, if you want I can specifically assign a Python extension dev to my port attributes test plan item for endgame next week. |
Here are few scenarios we are creating ports, and where I think forwarding will be required and where it is not. Debugger scenariosI had a discussion with Cases to consider:
I don't think the above two cases are where the API will be used. Web app scenariosThese are cases that involve running some web app framework, like
Data Science
|
The debugger scenarios sound reasonable to me. For the web app scenarios:
VS Code will automatically forward this anyway. VS Code detects ports in two possible ways based on what settings the user has: watching the proc filesystem and/or watching terminal/debug output. It sounds like this is also desirable behavior.
Yes, the port will be automatically forwarded.
If you want to have the port forwarded in this case then you shouldn't have to do anything. |
@paulacamargo25 I'm ready to finalize the port attributes API. I'd love to get feedback from you or someone else on the Python team before I do so. Is adopting this API work that is planned for September? |
@alexr00 This is planned for September Milestone. Adding debugger owners to provide any input they have. @int19h @AdamYoblick |
@alexr00 I had a look, and my main concern is the inherent asynchrony between the debugger processes and VSCode. For internal ports, to avoid clashing with anything else, the debugger typically does |
@int19h thank you for looking at the API and providing feedback! You are correct that there's no guarantee that
Given these inherent delays, which can easily be > 1 second, and will almost always be hundreds of milliseconds, I don't think we should let perfect be the enemy of better here. |
Original post: microsoft/vscode#115616 (comment)
In a remote environment (Codespaces, Dev Containers, etc.) VS Code will automatically detect and forward ports that it finds processes listening on so that users can access the remote application they're developing from their local machine. This includes debugees, such as a Python program that the user is debugging.
The auto port forwarding can't distinguish between a useful port to forward (ex. the app that you're debugging) and a useless port (ex. the port that the debugger itself uses for communication). This results in noisy extra ports being forwarded. We've seeing this in other extensions, such as the JS Debug extension.
The proposed solution for this is to allow extension to provide port attributes for ports that they know about. The JS Debug extension has done this for the debug ports it uses: https://github.com/microsoft/vscode-js-debug/blob/0d0704da3726653e2d806be528b8ab51fa952cf0/src/ui/portAttributesProvider.ts#L39-L55
We're working on finalizing the port attributes API, so I don't expect too many more changes. In support of finalizing the API, and to remove the port-clutter that comes from forwarding Python extension debug ports, it would be great if the Python extension adopted the proposed port attributes API.
The text was updated successfully, but these errors were encountered: