Skip to content
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

Improve VS Code remote support when running as a "UI" extension #1260

Closed
ejizba opened this issue Sep 10, 2019 · 1 comment
Closed

Improve VS Code remote support when running as a "UI" extension #1260

ejizba opened this issue Sep 10, 2019 · 1 comment
Assignees
Labels
remote VS Code remote

Comments

@ejizba
Copy link
Contributor

ejizba commented Sep 10, 2019

In VS Code remote scenarios, users can choose to run as a "workspace" extension (aka in the remote environment) or as a "UI" extension (aka in the local environment). Per #954, we made the default "workspace". However, there are a few scenarios where users might want to run as a "UI" extension, for example:

  1. In a dev container to avoid running docker in docker
  2. If they have an ssh/wsl workspace open, but they want to work with their local docker instead

NOTE: When running as a UI extension, the best we can do is replicate the experience users have with a non-remote instance of VS Code. In other words, users aren't blocked from any functionality since they could just have two instances open (one remote and one local), but fixing this issue would mean they could have all functionality in once instance.

There are two main scenarios that won't work when running as a "UI" extension. In #1233, I added an error that blocks users from even trying:
Screen Shot 2019-08-28 at 2 55 03 PM

NOTE: This warning can be disabled with the setting docker.showRemoteWorkspaceWarning

1. Terminal commands

Many of our features work by sending a command to the terminal. Unfortunately, when running as a UI extension, VS Code will always create a terminal in the remote environment. This causes errors like the following to occur because the container id doesn't exist in the remote environment or docker isn't even installed.

Screen Shot 2019-08-27 at 11 36 12 AM

We could fix this in two ways:

  1. Convert terminal commands to use Dockerode (which is ultimately just using REST APIs and skipping the terminal). The "prune" command is an example that uses Dockerode and works. The "view logs" command is an example that uses the terminal and doesn't work
  2. Ask VS Code to provide an API to create a terminal in the local environment when running as a UI extension. This PR and this comment seem to imply it's already possible, but I never got it to work and the behavior is certainly not officially documented yet.

2. File System commands

A few commands interact directly with the file system (most importantly "Add Docker Files to Workspace"). These don't work when running as a UI extension because it will use the local file system which won't match the workspace. Users will see errors like this:
Screen Shot 2019-08-27 at 11 36 39 AM

The only way I could see us fixing this is with an API from VS Code to somehow access the remote file system directly. Per #954 (comment), this API doesn't exist yet, but they are considering adding it.

Also note it appears Intellisense also doesn't work when running as a "UI" extension. This may or may not be related to the file system discrepancy.

@ejizba ejizba added the remote VS Code remote label Sep 10, 2019
@dbreshears dbreshears added this to the Future milestone Oct 28, 2019
@karolz-ms
Copy link
Contributor

@EricJizbaMSFT and I talked. We could not think of any compelling remote development scenario that would involve the extension running as "UI" extension. Haven't seen any related feedback from users either. Closing for now--we will reopen if we learn something to the contrary.

@bwateratmsft bwateratmsft removed this from the Future milestone Nov 4, 2019
@vscodebot vscodebot bot locked and limited conversation to collaborators Dec 16, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
remote VS Code remote
Projects
None yet
Development

No branches or pull requests

4 participants