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

Allow vscode.env.asExternalUri to return valid results for workspace URIs #124263

Closed
joaomoreno opened this issue May 20, 2021 · 1 comment
Closed
Assignees
Labels
api api-finalization feature-request Request for new features or functionality insiders-released Patch has been released in VS Code Insiders on-testplan
Milestone

Comments

@joaomoreno
Copy link
Member

Our current API vscode.env.asExternalUri currently does two things:

  • For /^https?/ URIs, it translates remote URIs into URIs which can be handled locally
  • For ${appScheme} URIs, it massages extension handling URIs

What if we augment that API to handle any URI scheme, namely URIs which represent workspaces? Here's how that could look like:

  • On the desktop, the API would return a URI with the ${appScheme} protocol which would open the given workspace when invoked. So, asExternalUri('file://Users/joao/Desktop') would return something like vscode://open?uri=file%3A%2F%2FUsers%2Fjoao%2FDesktop.
  • On an embedder web scenario like, the API would return the exact URL which would be open in the browser if invoked with vscode.open.
@joaomoreno joaomoreno added this to the May 2021 milestone May 20, 2021
@joaomoreno joaomoreno self-assigned this May 20, 2021
@joaomoreno
Copy link
Member Author

joaomoreno commented May 21, 2021

Things to test:

  • VS Code can now handle uris such as code-oss:workspace?file:///home/joao/Work/vscode. It will treat the query of said URI as the URI of the workspace to open. In this case it would open the workspace in file:///home/joao/Work/vscode.
  • The vscode.env.asExternalUri API should throw if the provided URI can't be opened as a workspace. This matches the current API behavior which would throw whenver the scheme would be different from https? or the app protocol scheme

cc @eamodio

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
api api-finalization feature-request Request for new features or functionality insiders-released Patch has been released in VS Code Insiders on-testplan
Projects
None yet
Development

No branches or pull requests

3 participants
@joaomoreno @jrieken and others