alefragnani / vscode-project-manager

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

[FEATURE] - Quick way to open a folder from remote filesystem inside VS Code Remote instance #642

Closed MurzNN closed 1 year ago

MurzNN commented 2 years ago

Will be good to add ability to quickly open favorite local folder inside current VS Code Remote instance. This is very useful when work with many temporary projects inside Docker containers, using the same folder to store project files. So I don't want to create a separate VS Code Project for each one, just quickly open the workspace folder inside a container.

Now I need to do:

  1. Attach VS Code Remote to a Docker container.
  2. In "Open folder" menu manually open needed folder (usually /var/www/html).

When I try to add a project with path /var/www/html via vscode-project-manager extension, and press "Open" on it inside a VS Code Remote instance - it exits from the Remote instance and open the folder from my local machine.

If I already can configure the vscode-project-manager extension to open local folder - please describe how.

If not - maybe add some special protocol? Something like this:

[
    {
        "name": "ddev-container",
        "rootPath": "current-instance:/var/www/html",
        "paths": [],
        "tags": [],
        "enabled": true
    }
]
alefragnani commented 2 years ago

Hi @MurzNN ,

Projects can be local or remote, and VS Code will open it accordingly. If you are connected to some remote instance and decide to open any local or remote folder, VS Code will disconnect from that remote and open the new folder on a new instance. This is how VS Code works, natively, as you can see the same behavior if you use the builtin Open Folder command.

On the other hand, if your Docker container has a lot of interesting folders that you want to become Favorite Projects, you could install the extension on that remote, as it was a new machine (https://github.com/alefragnani/vscode-project-manager#working-with-remotes).

I guess the best solution for you would be VS Code multi-root workspace supporting local and remote folders, because you could combine that docker container with your local folders, on the same workspace. I wonder if such feature should be asked in VS Code (https://github.com/microsoft/vscode) or VS Code Remote (https://github.com/microsoft/vscode-remote-release) repo.

Hope this helps

MurzNN commented 2 years ago

Thanks for the explanation! I'm asking not a complex feature with multi-root workspace, but just an automation to open a pre-defined folder as a workspace inside a current instance of VS Code, via one click.

That, via a single click, basically, chooses "File » Open folder" menu option, types the desired folder (selected from pre-defined list, eg /var/www/html), presses "Enter", that's all.

Additionally will be cool if it will create a new workspace file there, with pre-defined settings (It can be copied from some template file). But the basic functionality will be already useful!