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

[ENHANCEMENT] - Support WSL locations in baseFolders settings #487

Open
TomYeoman opened this issue Apr 9, 2021 · 7 comments
Open

[ENHANCEMENT] - Support WSL locations in baseFolders settings #487

TomYeoman opened this issue Apr 9, 2021 · 7 comments
Labels
enhancement remote Remote Development

Comments

@TomYeoman
Copy link

TomYeoman commented Apr 9, 2021

Environment/version

  • Extension version: v12.1.0
  • VSCode version: 1.55.1
  • OS version: Win 10 / Ubuntu 16.04

Information

I'm trying to use project manager to manage all my remote projects in WSL (I only work in WSL, and have no interest in opening anything in windows if possible)

Steps to reproduce

  1. Install project manager
  2. Add some base folders from inside my ubuntu to settings
 "projectManager.git.baseFolders": [
    "\\\\wsl$\\Ubuntu-18.04\\home\\wsl-tom\\git\\flyt\\flyt-connect"
  ],
  1. Try to open one of them - but it opens in windows rather than remote WSL

Seems that saving a project once I'm in WSL remote works (I.E it will open again in WSL)- but I'm insure on how to point to "WSL" projects?

Working -

image

Not working -

image

I tried updating baseFolders with this path structure that opens the int-bk-spain project correctly in a WSL session, but no luck -

"projectManager.git.baseFolders": [
  "vscode-remote://wsl+ubuntu-18.04/home/wsl-tom/git/flyt/flyt-connect"
],
@TomYeoman TomYeoman added the bug label Apr 9, 2021
@tyler36
Copy link

tyler36 commented Apr 16, 2021

Confirmed.

  • Project Manager can find projects when given a projectManager.git.baseFolders setting such as "\\\\wsl$\\Ubuntu\\home\\sites
  • However, these will open in as a normal "windows" workspace
  • Opening a WSL project and saving in favorites will open the project via the "vscode-remote://wsl" correctly

@tyler36
Copy link

tyler36 commented Apr 16, 2021

This probably relates to #486 and the way MS handles all 3 remote extensions

I extention works as intended, it scan the provided paths for projects and opens them. However, the expectation is seems to be scan a WSL folder and open in WSL, scan a SSH folder and open in SSH.

So perhaps there are 2 solutions paths:

  • Better path support: "vscode-remote://wsl+ubuntu-18.04/home/wsl-tom" is a scannable folder.
    Might be doable but might rely on Remote WSL API support?

  • Transform folder paths.
    A project discovered at "\\wsl$\Ubuntu-18.04\home\wsl-tom\git\flyt\flyt-connect" should be converted to "vscode-remote://wsl+ubuntu-18.04/home/wsl-tom/git/flyt/flyt-connect" and opened as such.
    This seems like a more do-able option. If it starts with "\\wsl$\" its a Remote-WSL and apply some regex black magic. This could also be added for Remote-ssh project.

@alefragnani
Copy link
Owner

Hi @TomYeoman ,

The baseFolders settings does not support remotes. If you need remote locations being recognized, you must install the extension on that remote. This has been discussed/defined in #323.

But @tyler36 pointed out an interesting alternative (thanks for that!), which I didn’t expect to work (neither anyone that discussed #323 has commented). So, I guess the doable alternative is really doable 😬

I never needed/had a chance to use WSL, until two days ago, so I can’t say it will handle all possible scenarios, but that’s a start.

Hope this helps

@alefragnani alefragnani added enhancement remote Remote Development and removed bug labels Apr 16, 2021
@alefragnani alefragnani changed the title [BUG] - Projects not opening in remote for WSL [ENHANCEMENT] - Support WSL locations in baseFolders settings Apr 16, 2021
@tyler36
Copy link

tyler36 commented Apr 19, 2021

I'm new with WSL2, but I have found the need to connect to WSL2 & remote projects increase.

I'm happy to test something if you need it.

@tyler36
Copy link

tyler36 commented Jul 12, 2021

Just saw the #477 in the "What's new ... 12.3" page. Thought I'd give it another whirl.

In Windows, icons display for correctly for favorites (folder or penguin for win or wsl respectivly).

Updated my user settings, as suggested in docs and reloaded the WSL folder

    "remote.extensionKind": {
        "alefragnani.project-manager": [
            "workspace"
        ]
    },
  • Favorites were empty
  • Git was empty

I added a WSL location to my base folder

    "projectManager.git.baseFolders": [
        "$home/code",
    ],

And it worked!

  • it shows WSL projects under git
  • I can save a favorite
  • favorites in WSL do not show with the penguin icon though
    • If I edit projects, it seems to be saving as a /home/dev/code/test. I guess on a Windows host, your detecting the remote or wsl words and changing icon?

-It's not showing my Win projects though from WSL. I wonder if there is a way to share config files. Is this related to #525 ?

Anyway, it seems OPs problem has been fixed as basefolders works from Windows or WSL context.

Thank you for continuing to update and support an already great extension. 👍

@alefragnani
Copy link
Owner

Hi @tyler36 ,

The documentation update was just that, an update to the docs. Nothing related to this issue has been made in the latest release. And I’m glad to see you did use the extensionKind as Workspace and see things working a bit more as you wanted, but as you may have noticed, it has it pros and cons.

Updated my user settings, as suggested in docs and reloaded the WSL folder

  • Favorites were empty
  • Git was empty

This is the expected behavior when you change the extensionKind to Workspace, because VS Code will work as installed on the remote and so, your Favorites and Git configurations will be there too.

favorites in WSL do not show with the penguin icon though

Because now, the project is not remote anymore. You are on the remote, so the project is local.

It's not showing my Win projects though from WSL.

Because remotes don’t see outside, so yes, it won’t be visible.

I’m planning to return to remote features on the upcoming releases so, stay tuned.

@tyler36
Copy link

tyler36 commented Jul 20, 2021

Thanks for the comprehensive response. It seems obvious now that I understand what was happening. I really don't know why it didn't click before.

I really like this extension, it makes bouncing between projects so fluid. I just wish my brain changed contexts as easily 😀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement remote Remote Development
Projects
None yet
Development

No branches or pull requests

3 participants