vscode-reveal icon indicating copy to clipboard operation
vscode-reveal copied to clipboard

Support running remotely for VS Code remote development

Open mjbvz opened this issue 5 years ago • 1 comments

Hi, 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. The localhost url show in the UI will also not be accessible from the user's local machine.

Potential Fixes

First off, if your extension does not actually need to run on the remote machine, just mark it as ui extension

If this extension does need to run remotely, we've introduced some new APIs that should make running it possible:

Please let me know if you have any questions about the issue or these apis. We've also put together a guide to help you test your extension in remote workspaces

mjbvz avatar May 02 '19 23:05 mjbvz

I love to do this ! Sure I will do it for a future version. Thank for the links

evilz avatar Sep 08 '19 09:09 evilz