vscode-remote-release icon indicating copy to clipboard operation
vscode-remote-release copied to clipboard

Workspace extensions can't access attached devices

Open jberenhaus opened this issue 3 years ago • 8 comments
trafficstars

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:

  1. Attempt to access attached devices in the remote extensions API
  2. Doesn't work :(

image

jberenhaus avatar Sep 12 '22 15:09 jberenhaus

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.

bamurtaugh avatar Sep 12 '22 15:09 bamurtaugh

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

aeschli avatar Sep 13 '22 07:09 aeschli

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.

jberenhaus avatar Sep 13 '22 20:09 jberenhaus

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.

aeschli avatar Sep 14 '22 18:09 aeschli

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 :)

jberenhaus avatar Sep 16 '22 15:09 jberenhaus

I'll at least assign myself for the docs update portion 😄.

bamurtaugh avatar Sep 16 '22 15:09 bamurtaugh

@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 avatar Sep 19 '22 07:09 aeschli

@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?

jberenhaus avatar Sep 19 '22 14:09 jberenhaus

Opened https://github.com/microsoft/vscode-docs/pull/5666 to update docs.

bamurtaugh avatar Sep 30 '22 17:09 bamurtaugh