Support running remotely for VS Code Remote Development
See original GitHub issueHi, I’m on the VS Code team. We recently released support for Remote Development and I believe that your extension may not work properly when run in a remote workspace
Problem
To make remote development as transparent as possible to users, VS Code distinguishes two classes of extensions:
-
UI Extensions: These extensions make contributions to the VS Code user interface and are always run on the user’s local machine. UI Extensions cannot directly access files in the workspace, or run scripts/tools installed in that workspace or on the machine. Example UI Extensions include: themes, snippets, language grammars, and keymaps.
-
Workspace Extensions: These extensions are run on the same machine as where the workspace is located. When in a local workspace, Workspace Extensions are run on the local machine. When in a remote workspace, Workspace Extensions are run on the remote machine. Workspace Extensions can access files in the workspace to provide rich, multi-file language services, debugger support, or perform complex operations on multiple files in workspace (either themselves or by invoking scripts/tools).
You can find more details about this architecture here.
Your extension is currently running as workspace extension. This means that the server it starts will be run on the remote machine, which in turn means that webview will not be able to access it using localhost
since the webview is running on the user’s local machine:
Potential Fix
We’ve introduced a new webview port mapping API that should make it possible for your extension to run remotely with fairly minor modifications.
Please let me know if you have any questions about the issue or the new apis. We’ve also put together a guide to help you test your extension in remote workspaces
Issue Analytics
- State:
- Created 4 years ago
- Reactions:23
- Comments:9
Top GitHub Comments
This will be fixed in PR #401 without configuring Remote-SSH to forward ports
Thans
Thanks According to your answer, I found a way to temporarily forward a new port for the duration of the SSH session. "
https://code.visualstudio.com/docs/remote/ssh