vscode: Opening a folder with custom scheme does not work (remote, desktop)
- VSCode Version: 1.51.0-insider
- Browser: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.75 Safari/537.36
Steps to Reproduce:
(Running an extension in Codespaces)
- Execute this command to open a folder in the current window. The URI is from a custom file system.
await commands.executeCommand('vscode.openFolder', uri, false /* forceNewWindow */);
- An error is thrown

Hovering over the workspace folder shows this warning:

Clicking on the workspace folder throws this error:

Does this issue occur when all extensions are disabled?: N/A
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Comments: 26 (19 by maintainers)
I just did some tests with the Azure Storage extension, and “Add to workspace” works properly when connected to the codespace from desktop VS Code. It doesn’t work in the web. I’ve filed a bug to fix that.
When opening the virtual folder directly, it fails for different reasons on web and desktop. Both are partially related to the fact that the uri that is being opened has an
azurestorageauthority, so VS Code attempts to open it with the Azure Storage extension instead of tunneling it through the Github Codespaces extension. This results in desktop VS Code trying to open the Azure Storage url on the desktop side without even trying to connect to the codespace through the GitHub Codespaces resolver. Nesting theazurestorageuri inside of a vscode workspace file works around this issue since the workspace is opened through Codespaces and then the folder inside the codespace uses the virtual file system. I’m not sure the best way to solve this. @bpasero, any ideas?@wwlorey, how are you opening the folder? Is it a folder in the same codespace, or a “Recent folder” from a different codespace? If it’s a recent folder from a different codespace AND that folder was added to the recent folder list prior to about a week ago, it won’t properly redirect to the new codespace.
We made a change about a week ago in how we store info in that recent folder entry which allows switching between codespaces, but only for entries added to the list after that time which has the necessary info in the entry.
It’s also not fully solved yet – if you switch codespaces through the recent folders list, it will only connect you back to the last-used folder instead of the requested folder, since the query param that includes the folder path gets dropped on the redirect through github.com auth for the codespace switch. That only applies when switching between codespaces though – switching to other folders within the same codespace is expected to work.
The window reloaded when I opened a folder in the current window (not adding it to my workspace) so it replaced the folder I had open. I executed the command in a single root workspace
I was using the web client