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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Document Link Provider] Adding Visual Studio Live Share support #174

Merged
merged 1 commit into from Mar 15, 2018
Merged

[Document Link Provider] Adding Visual Studio Live Share support #174

merged 1 commit into from Mar 15, 2018

Conversation

lostintangent
Copy link
Contributor

This PR adds support for Visual Studio Live Share to the document link provider, by ensuring that URI construction is done using the VS Code APIs which preserve the correct scheme. This is necessary because "guests" within a Live Share session see remote files using the vsls: scheme, whereas the the host (and non-Live Share users) sees files using the file: scheme. Therefore, this change preserves the existing behavior, while allowing REST Client users to click on < foo.js links within the context of a collaboration session 馃殌 Specifically, this PR makes the following two changes:

  1. Use Uri.toString() as opposed to Uri.fsPath, since the later strips the Uri's scheme, which removes the vsls: portion that is critical for Live Share.

  2. Use Uri.parse() as opposed to Uri.file(), since the later always appends the file:// scheme to the parse Uri, as opposed to parsing the provided string, and respecting its scheme (if there is one)

VS Live Share + REST Client integration is already really great, since the "host" can share a locally running REST API, and the "guest" can then author requests against it (see this video). This PR extends that experience by making sure the document links work for all participants in a collaboration session.

// CC @Huachao

@Huachao Huachao merged commit e9044a4 into Huachao:master Mar 15, 2018
@Huachao
Copy link
Owner

Huachao commented Mar 15, 2018

Thanks @lostintangent ! It's really a great addition to REST Client extension.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants