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

Feature Request: allow opening remote workspaces through extensions #6243

Open
christian-bromann opened this issue Jan 26, 2022 · 5 comments
Assignees
Labels
containers Issue in vscode-remote containers feature-request Request for new features or functionality
Milestone

Comments

@christian-bromann
Copy link

Hey 👋

I am developing a home screen extension that helps to manage different workspaces. One of my requirements is to allow opening remote workspaces, e.g. codespaces, remote machines etc.. Unfortunately there is not documentation about that and it appears to me that vscode.openFolder is not capable doing that. So far I know:

  • vscode.env.remoteName gives me the environment type, e.g. codespaces, which allows me to determine whether the workspace is local or remote
  • while searching this repo for more information I found that there is something like remote-containers.openFolder which is not documented though nor do the examples I found make any sense to me
  • I know VSCode is able to open codespaces through a like like vscode://github.codespaces/connect?name=<codespace-id> but creating a vscode.Uri in that form doesn't work

Any help on that matter is appreciated.
Thanks!

@github-actions github-actions bot added the containers Issue in vscode-remote containers label Jan 26, 2022
@chrmarti
Copy link
Contributor

There is currently no API (remote-containers.openFolder is used in the UI) for opening a dev container with Remote-Containers.

Not sure about Codespaces. @osortega Are the vscode://github.codespaces/connect URIs documented API?

@christian-bromann Do you need a way to open both Remote-Containers and Codespaces dev containers or are you mainly interested in Codespaces? Is the home screen extension you mention a VS Code extension?

@chrmarti chrmarti self-assigned this Jan 31, 2022
@chrmarti chrmarti added the info-needed Issue requires more information from poster label Jan 31, 2022
@christian-bromann
Copy link
Author

@chrmarti thanks for the reply.

I need a way to open all possible workspaces, local and remote ones. The home screen VSCode extension extension has a widget that displays all workspaces a user has been working on and allows to easily switch back and forth. So ideally I am looking for a way to open all kind of projects, local or remote ones (run in a remote container or codespaces).

@chrmarti chrmarti added feature-request Request for new features or functionality and removed info-needed Issue requires more information from poster labels Feb 1, 2022
@chrmarti chrmarti added this to the Backlog milestone Feb 1, 2022
@osortega
Copy link

osortega commented Feb 1, 2022

I don't think we have those URIs documented anywhere but our protocol handler should be able to pick up a URI with the following structure as long as the extension is installed.
vscode://github.codespaces/connect?name=${encodeURIComponent(<codespace-name>)}

Hope this helps

@christian-bromann
Copy link
Author

@osortega how would I open such a codespace? I tried with the openFolder command with the exact same vscode.Uri without success.

@osortega
Copy link

osortega commented Feb 1, 2022

Can you try with

const uri = vscode.Uri.parse(`vscode://github.codespaces/connect?name=${encodeURIComponent(<codespace-name>)}`);
vscode.env.openExternal(uri);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
containers Issue in vscode-remote containers feature-request Request for new features or functionality
Projects
None yet
Development

No branches or pull requests

3 participants