microsoft / vscode

Visual Studio Code
https://code.visualstudio.com
MIT License
163.64k stars 29.04k forks source link

Test: finalization of env.asExternalUri api #83492

Closed mjbvz closed 4 years ago

mjbvz commented 4 years ago

Test for #82896

Complexity: 4

Overview

This iteration, vscode.env.asExternalUri was finalized. This api lets extensions resolve a uri in the local environment to one in the client environment. If the extension is running remote, resolving a localhost uri will automatically open a tunnel that the client can use to connect to the requested port on the remote.

The asExternalUri function should use the same basic logic as the openExternalUri api, however instead of opening the uri in the browser, it returns the resulting uri to the extension.

In addition, handles vscode: uris specially for embedders.

Testing

Write a simple extension that uses asExternalUri. I've provided an example here: https://github.com/mjbvz/vscode-test-asExternalUri

Using this test extension, check the following:

aeschli commented 4 years ago

Tested on Linux with a Node Docker Container. HTTP, HTTPS, no issues found.

@mattbierner I don't understand the last paragraph: How is vscode.env.uriScheme is related to the tunneling. asExternalUri specs it only works with http and https, how could I use the 'uriScheme' ?

aeschli commented 4 years ago

Also tested remotes running in WSL1 and WSL2. Extended sample code: https://github.com/aeschli/vscode-test-asExternalUri/tree/aeschli/test

dbaeumer commented 4 years ago

Tested under Remote WSL.

JacksonKearl commented 4 years ago

What is meant by "In addition, handles vscode: uris specially for embedders."?

mjbvz commented 4 years ago

See #82884, the previously proposed env.createAppUri api was merged into vscode.env.asExternalUri

@bpasero Any advice on testing this besides the example outlined in the documentation?

JacksonKearl commented 4 years ago

Tested on MacOS with Linux over SSH and Windows over SSH.

bpasero commented 4 years ago

I think @RMacfarlane uncovered issues with app URIs so I think this can currently not be verified.