vscode-remote-release
vscode-remote-release copied to clipboard
Workspace extensions can't access attached devices
In the remote extensions API guidance, there's a known issue in the documentation that workspace extensions can't access attached devices. I didn't see an issue for this and would love to get more information on what the plan is to support this or how we could potentially contribute to the project!
https://code.visualstudio.com/api/advanced-topics/remote-extensions#known-issues
- VSCode Version: 1.63.2022083104
- Local OS Version: Windows 10 19044
Steps to Reproduce:
- Attempt to access attached devices in the remote extensions API
- Doesn't work :(

Thanks for opening! @Chuxel @aeschli do you know if we have an outstanding feature request for this one? I also didn't immediately find out.
If you want to access resources/devices on the machine on which the UI runs, your extension needs to be set as 'UI' extension.
The extensionKind property is for that and https://code.visualstudio.com/api/advanced-topics/extension-host has more information
Thanks for the response @aeschli. I think the issue is more akin to the supporting reverse tunneling issue in the vscode repo.
The hope is that we have an API that allows for remote port forwarding (in the ssh -R sense) in addition to the existing local port forwarding (in the ssh -L sense). The UI extension would only allow us to local port forward.
Specifically, we'd love to be able to have the remote able to run adb commands and forward them to a local android device.
One approach to overcome this is to create a companion UI extension whose job is to access the local Android device and offers commands (and maybe views) that also the remote extension can invoke. Agreed it's not a tunnel, but it's more structured and specific than a general tunnel mechanism.
Thanks for the suggestion. That's definitely possible but it's a lot more work than just tunneling ports. Right now we launch an external ssh process to do the tunneling which is less than ideal but kind of works. Having a solid API that's part of VS Code would be much more reliable and would save us a bunch of dev time.
Should we spend the time investing in a companion extension or do we think we can modify VS Code to add an API to make this possible?
Also we should update the documentation if it's a known issue that we don't plan on implementing. It says it's still under investigation :)
I'll at least assign myself for the docs update portion 😄.
@jberenhaus Let's use https://github.com/microsoft/vscode/issues/100222 to revive the discussion on a reverse tunnel feature. We will use this the current issue for the doc improvements (thanks @bamurtaugh !)
@aeschli Sounds good. Would you or @bamurtaugh be able to drive this to see if we can get an owner to work on the issue?
Opened https://github.com/microsoft/vscode-docs/pull/5666 to update docs.