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

Support Remote Container #284

Closed
nikaro opened this issue Jun 11, 2019 · 23 comments
Closed

Support Remote Container #284

nikaro opened this issue Jun 11, 2019 · 23 comments
Labels
enhancement remote Remote Development
Milestone

Comments

@nikaro
Copy link

nikaro commented Jun 11, 2019

With VSCode 1.35 comes Remote functionnality. And so when your are in a "container environment" the project list is no more available, which is normal since it is stored in a file on the host file system (not reachable from the container).

To make it works, it seems that you need to use vscode.ExtensionContext API. Cf. https://code.visualstudio.com/api/advanced-topics/remote-extensions#persisting-extension-data-or-state

@alefragnani
Copy link
Owner

Hi @nikaro ,

Yep, it does not support Remote Development yet...

Thanks for reporting

@alefragnani alefragnani added enhancement remote Remote Development labels Jun 27, 2019
@alefragnani alefragnani changed the title Does not work in Remote Container Support Remote Container Nov 17, 2019
@jbutz
Copy link

jbutz commented Dec 3, 2019

Supporting the WSL Remote would also be amazingly helpful

@Christilut
Copy link

Would be great if this can be merged! I'm running environments in WSL and in Windows and I can't really use Project Manager now because it only shows the projects in it's current environment.

@alefragnani alefragnani added this to the 10.10.0 milestone Jan 25, 2020
@alefragnani
Copy link
Owner

Based on #318 (comment), the Remote Development support for now means:

You can

  • Open any projects using the Open and Open in New Window commands
  • Use the Side Bar, and most of its commands

You can not

  • Save projects using the Save Project command

I'm not sure I'll dig in full support for Remote Development scenarios. Let's wait and see how it goes 😄

@Christilut
Copy link

I just tried it and I see my local projects when running either a local or remote project. So my remote projects are not visible at all now and I can't add them with the Save Project option because I get the message Command 'Project Manager: Save Project' is not enabled in the current context..

Can I add remote projects manually in the JSON or is this combination not supported?

@alefragnani
Copy link
Owner

Hi @Christilut

I just tried it and I see my local projects when running either a local or remote project.

That's the intention of this update. You are now able to see and open your projects, even while connected to Remotes. You can't however, save projects when connected to Remotes, yet.

I didn't find a way to detect/identify a remote, like the Open Recent command does. In fact, I'm not sure there is an API for that 😢 . I'll have to investigate that in the future, to see if that's doable.

Hope this helps

@Christilut
Copy link

Okay, but that does effectively mean that opening remotes is also not possible? Because that was possible before this update but only when inside the remote environment.

It would be fine if I could manually add a remote project to the JSON file, but I don't know the syntax to do that.

@alefragnani
Copy link
Owner

Because that was possible before this update but only when inside the remote environment.

How was it possible, if the extension itself wasn't available while connected to remotes? Have you manually installed in the remote?

It would be fine if I could manually add a remote project to the JSON file, but I don't know the syntax to do that.

The JSON syntax is fairly easy (see below - extracted from README), but the Remote Folder Syntax on the other hand, I don't know (that what I called an API)

{
        "name": "Pascal MI",
        "rootPath": "c:\\PascalProjects\\pascal-menu-insight",
        "paths": [],
        "group": "",
        "enabled": true
    },

@Christilut
Copy link

Christilut commented Jan 26, 2020

I guess it was installed in the remote, VSCode extensions are a bit of a mystery to me..

The thing is, some users only use remote development (eg WSL) which means that this extension doesn't work at all for them right now. I'm in between, I mainly use WSL and for some things I'm forced to use Windows.

I tried using the lxss path, eg AppData\\Local\\Packages\\CanonicalGroupLimited.Ubuntu18.04onWindows_79rhkp1fndgsc\\LocalState\\rootfs\\... but VSCode doesn't recognize it as remote. And editing rootfs from Windows is a very bad idea.

But maybe there is a way to open this path while telling VSCode that it should use a remote? The extension has all these options, maybe they are of help?
image

I don't have any extension knowledge at all so I don't know the practical limitations..

@alefragnani
Copy link
Owner

I'm not sure how the extension works when installed in remotes. I suspect the projects were being saved inside of the remote, but oddly, when I did that with another extension, I have a few erros related to saving extension's resources, which I suspect would happened to Project Manager as well.

I don't use remotes that much. Just a bit of Containers, but mostly running instead of connecting.

I tried to find how that extensions works, but it appears their source code are not available. I'll probably have to ask the VS Code team for proper API.

@Christilut
Copy link

Alright, thanks for the all the effort put into everything :)

@artbycrunk
Copy link

Hi @Christilut
the workflow that you are aiming for, will require you to add this to the settings.json

"remote.extensionKind": {
         "alefragnani.project-manager": "workspace"
}

In the case that the extension is installed on the remote as well as the local, this setting will use the remote extension over the local one.

@alefragnani the reason it worked before is cause the global storage API in remote mode will pick up the /User/ location on the remote end.
This new update kind of cripples the save project functionality for remotes, even if the extension is running remotely, that seems like a bug.

@alefragnani
Copy link
Owner

Hi @artbycrunk ,

If I let the Save Project command enabled while running remotely (not installed remotely), the project is saved with the wrong path, thinking it was a local path, which was not. This is a bug 😄.

Installing the extension on remotes wasn't an expected/tested/supported scenario, simply because I don't use remotes that much, and I'm still trying to figure out the needs. I'm not sure installing the extension on remote is the correct way to use it. To me, the projects should be stored locally, being able to open on remotes when selected. To do this, I need an API, which I don't know exists.

The new update is the first step on support for remotes. The idea was to bring back the ability to view and open projects, even when you are connected on remotes.

At first sight, I don't see why to install the extension remotely, because doing so, you will have a set of projects for each remote. If that's the case, please fill a new issue, describing the desired scenario, so it could be tracked properly.

@gencer
Copy link

gencer commented Jan 26, 2020

@alefragnani Few days ago, I was able to save/load projects from remotes using your extension.

When I'm on Windows-host, I see my local projects and save them or load them locally. When I connect to remote linux-guest, I was also able to save and load remote projects too. This allows me to separate local and remote projects.

Today, When this extension got updated, I just lost this feature. To achieve same task i did this:

"remote.extensionKind": {
         "alefragnani.project-manager": "workspace"
}

However, I cannot save anything anymore.

All I'm saying, Previous behavior was working flawlessly. Why did this changed?

How can I enable save on remote?

@alefragnani
Copy link
Owner

Hi @gencer ,

What do you mean about separate local and remote projects? When you are connected to remotes, the projects were saved separately (on remote) instead of locally?

All I'm saying, Previous behavior was working flawlessly. Why did this changed?

It wasn't flawlessly because when connected to remotes, the extension wasn't enabled anymore. So, I had to update the extension to recognise remote scenarios, and be enabled/available, without the need to install it on each remote. As commented here, the Save Project command were disabled because if would save remote folders, thinking to be local, which would lead to fail while opening.

I have created #323 to track improvements in Remote Development support. I would like to know user's scenarios/expectations, to decide the next steps.

Hope this helps

@Christilut
Copy link

Christilut commented Jan 27, 2020

I think @gencer was in the same situation as me.

It wasn't flawlessly because when connected to remotes, the extension wasn't enabled anymore.

This isn't true? It was running on the remote and worked to select other remote projects. If you only use remote development then the old version worked 100% with remotes. However currently it doesn't work for remotes at all anymore.

@pschoffer
Copy link

pschoffer commented Jan 27, 2020

I had the same issue. I am using VSCode mostly in the remote mode. But I found this a workaround. There is a bit complicated way to downgrade extension:

  • Uninstall the extension

  • Download the previous version directly https://alefragnani.gallery.vsassets.io/_apis/public/gallery/publisher/alefragnani/extension/project-manager/10.9.1/assetbyname/Microsoft.VisualStudio.Services.VSIXPackage

  • Change the file name so that has .vsix extension so for example Microsoft.VisualStudio.Services.VSIXPackage => extension.vsix

  • in VsCode run the Extensions: Install from VSIX... and navigate to the place you downloaded the file in the above step

  • Then a restart (or three in my case for some reason)

  • and profit ...

I followed this tutorial with pictures: https://tpodolak.com/blog/2017/04/09/downgrading-visual-studio-code-extension/

@pschoffer
Copy link

@alefragnani BTW I love the extension! Awesome work.

I would suggest maybe some settings flag, for this new behavior as it seems to break some peoples' workflows. But I know 0 about the extension development, so no idea how difficult that would be:)

@artbycrunk
Copy link

@pschoffer you are doing some overly complicated process to downgrade the extension,
a simpler way is to

  • Go to extensions view and right-click on the project Manager extension.
  • Select "Install another version" from the popup menu.
  • This will bring up a list of all available versions for the selected extension.
  • Just select a previous version that you want.
  • and profit...

@alefragnani I have added info about my workflow to #323

@alefragnani
Copy link
Owner

@Christilut Good to know it's the same situation 👍

@pschoffer You don't need all this steps. Just use the built in command Install Another Version.. in Extensions Side Bar, like the picture below:

Screen Shot 2020-01-27 at 12 46 10

@artbycrunk Yep, I noted, thanks 👍

@pschoffer
Copy link

This proves me knowing 0 about extensions:) Thanks, guys!

@alefragnani
Copy link
Owner

I suggest others which feels to be locked with the newer release, to downgrade to the previous release (10.9.1) until a new update is released.

@alefragnani
Copy link
Owner

I'll lock this thread, and #318, so we could concentrate the comments/feedback about Remotes on the newly created issue (#323).

I'll keep track on both, so you don't need to copy/paste your previous comments

Repository owner locked and limited conversation to collaborators Jan 27, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement remote Remote Development
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants