alefragnani / vscode-project-manager

Project Manager Extension for Visual Studio Code
GNU General Public License v3.0
1.89k stars 225 forks source link

[BUG] - Git projects not detected #669

Closed blu28 closed 1 year ago

blu28 commented 1 year ago

Version: 1.74.2 Commit: e8a3071ea4344d9d48ef8a4df2c097372b0c5161 Date: 2022-12-20T10:29:14.590Z Electron: 19.1.8 Chromium: 102.0.5005.167 Node.js: 16.14.2 V8: 10.2.154.15-electron.0 OS: Windows_NT x64 10.0.19045 Sandboxed: Yes

Name: Project Manager Id: alefragnani.project-manager Description: Easily switch between projects Version: 12.7.0 Publisher: Alessandro Fragnani VS Marketplace Link: https://marketplace.visualstudio.com/items?itemName=alefragnani.project-manager Steps to reproduce

  1. Set Git projects basefolder to a folder with multiple folders with .git folders in them. There are some other that do not.
  2. The Git tab of the Project Manager panel does not show any git projects. It just asks if I want to disable git projects or open the settings.

I had this problem on two systems, but the Git projects started showing up on one for no apparent reason. I have gone through all of the settings in the settings.json file and they are the same. The only difference I can see in the OS is that this one is version 19045 and the working one is 19044, but it was 19044 when it wasn't working too. I don't see any way to get debug output from the extension, so I pretty much got stuck. If there is some kind of error happening, the extension should have an error message.

jafnhaar commented 1 year ago

Got the same problem. Project manager works fine on Linux/mac os systems. But not on windows with WSL2.

alefragnani commented 1 year ago

Hi @blu28 ,

I use both Windows 10 and 11, with no issue. Not sure why it wouldn't work for you. Could you please share how are your settings?

Could you please open Developer: Toggle Developer Tools and look at Console for some error message?

Thanks in advance

alefragnani commented 1 year ago

@jafnhaar ,

I'm not sure what you mean about not on Windows with WSL2. Do you mean you have git repos inside a WSL and would like to display those projects inside VS Code?

Thanks in advance

Flydiverny commented 1 year ago

Yes, I am using WSL2 where all code, git etc is always handled inside WSL. But using vscode installed in Windows with the remote host for WSL

Cito commented 1 year ago

Yes, I am using WSL2 where all code, git etc is always handled inside WSL.

Reasoning behind this: If you're using docker based dev containers, this is much more performant and things like hot reloading (detection of file changes) and file permissions do not work properly if the project is located on the normal Windows filesystem.

alefragnani commented 1 year ago

@Flydiverny @Cito

If your repositories are located inside the remote (WSL, Container or SSH) you must install the extension on that remote, in order to see the projects of that remote, when connected to it.

The extension isn’t be able to show remote projects if the extension is installed only on the host.

More details here https://github.com/alefragnani/vscode-project-manager#working-with-remotes

Hope this helps

Cito commented 1 year ago

@alefragnani I think the problem is that the plugin doesn't show that "Install in WSL" or "Install in Dev Container" button that other plugins have, so I can't do that. There is just a button "Install" ("Install locally") on the Project Manager plugin page, and if you click that, it says "This extension is enabled globally.", and you can only uninstall or disable it.

alefragnani commented 1 year ago

It's not an extension issue, but how VS Code works. If the extension is primarily to work on the Host, the button isn't displayed.

That's the reason why you have to tell to VS Code that you want the extension to be remote first instead, using the setting described in the documentation I linked above, more specifically https://github.com/alefragnani/vscode-project-manager#but-what-if-i-do-most-of-my-work-on-remotes

Updating your settings, when you open a remote connection, VS Code will display the Install in WSL... button.

Cito commented 1 year ago

@alefragnani Thanks a lot and forgive me for forgetting to RTFM. With that setting, it works as expected. At least what WSL concerns. When opening a devcontainer in WSL, then it does not work because it can only access the container. Probably nothing that can be done about that.

alefragnani commented 1 year ago

@Cito no need to apologize, it happens. Remote Development by itself has its own peculiarities and not everything works as we expect. Continuous learning...

Enjoy 😬

Flydiverny commented 1 year ago

This sure did the trick to install it correctly :D thanks!

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

I was looking at parts of that remote working section in the readme but clearly not good enough 🙈 I think what's a bit confusing as well, is that you get the possiblity to set settings in the remote and user even if you install it normally, and I tried a couple of variants there image

but now with the JSON config above it works great with just setting it in User tab to my git root 👌