Open christian-bromann opened 2 years ago
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 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).
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
@osortega how would I open such a codespace? I tried with the openFolder
command with the exact same vscode.Uri
without success.
Can you try with
const uri = vscode.Uri.parse(`vscode://github.codespaces/connect?name=${encodeURIComponent(<codespace-name>)}`);
vscode.env.openExternal(uri);
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 remoteremote-containers.openFolder
which is not documented though nor do the examples I found make any sense to mevscode://github.codespaces/connect?name=<codespace-id>
but creating avscode.Uri
in that form doesn't workAny help on that matter is appreciated. Thanks!