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

Test: Allow vscode.env.asExternalUri to return valid results for workspace URIs #127367

Closed
2 tasks done
joaomoreno opened this issue Jun 28, 2021 · 4 comments
Closed
2 tasks done

Comments

@joaomoreno
Copy link
Member

joaomoreno commented Jun 28, 2021

Refs: #124263

Complexity: 3

Create Issue

Create Issue


Up until now, the vscode.env.asExternalUri API has been limited to http:, https: and ${appScheme}: URIs. It would throw an error if you give it any other URI. With #124263, any other URI is assumed to be a workspace URI and VS Code should return a system-openable URI which opens that workspace. For example, give it file:///path/to/existing/folder and you get something which you can paste on a browser location bar and it should open that folder in VS Code.

This API just went stable, so please test you can successfully use it without having enableProposedApi: true.

Create a sample extension. Then invoke that API and:

  • Test that using http:, https: and ${appScheme}: works just as before
  • Test that it never throws for schemes which VS Code can open as a workspace, eg file:. A good sample is vscode.env.asExternalUri(vscode.workspace.workspaceFolders[0]!.uri), which should produce a system-wide URI which opens the current workspace.
  • Test that it throws for schemes unknown to VS Code, eg asdf:
@joaomoreno joaomoreno modified the milestones: July 2021, June 2021 Jun 28, 2021
@ghost ghost assigned rebornix and weinand Jun 29, 2021
@weinand
Copy link
Contributor

weinand commented Jun 29, 2021

Minor doc issues in vscode.d.ts:

  • "Resolves a uri to form that is accessible externally.":
    • "Resolves a uri to a form ..."
    • "externally": externally to what? outside of VS Code?
    • "accessible": is the sense of "reachable"?
  • "Extensions should not make any assumptions about the resulting uri and should not alter it in anyway." -> "... any way."

joaomoreno added a commit that referenced this issue Jun 29, 2021
address feedback in #127367
@weinand weinand removed their assignment Jun 29, 2021
@weinand
Copy link
Contributor

weinand commented Jun 29, 2021

@joaomoreno asExternalUri-generated links (e.g. vscode-insiders:workspace?file%3A%2F%2F%2FUsers%2Fweinand%2FDesktop%2Furitest) work fine in Chrome, Edge, and Firefox. But Safari just googles for them. Do you know why?

@rebornix rebornix removed their assignment Jun 29, 2021
@joaomoreno
Copy link
Member Author

Unsure... The right way to test on macOS might just be on the Terminal with open URL.

@weinand
Copy link
Contributor

weinand commented Jun 29, 2021

@joaomoreno good idea, thanks!

@github-actions github-actions bot locked and limited conversation to collaborators Aug 13, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants