Adding support for Visual Studio Live Share#2
Adding support for Visual Studio Live Share#2micnil merged 1 commit intomicnil:masterfrom lostintangent:master
Conversation
|
Thanks fo your pull request! Visual Studio Live Share seems awesome! I can see how it would be very powerful for pair programming and reviewing code. Might be cool to combine with a in-IDE chat like codestream. Your refactorings seem to preserve the current functionality nicely. However, in the upgrade scenario all existing checkpoints will not be able to open anymore. Not a big problem seeing Checkpoints only has 39 installs so far, but since this will be a recurring problem everytime (breaking) changes are made to the store state, I should work on a upgrade strategy before publishing. I'm thinking that i'll introduce a Thanks again, |
|
@micnil Thanks! I’d like to write a simple “recipe” for the Live Share docs that demonstrates using it with this extension. So I’ll keep an eye out for when you release an update to the marketplace. Also, if you’re interested in Live Share, send me an email (joncart@microsoft.com) with the email address that you’d like to be invited, and I’d love to get your feedback on it :) |
This PR adds support for Visual Studio Live Share, by ensuring that all serialization and parsing of document URIs are done using the VS Code APIs which preserve the correct scheme. This is important because "guests" within a Live Share session see remote files using the
vsls:scheme, whereas the the host, as well as non-Live Share users, would see files using thefile:scheme. Therefore, this change preserves the existing behavior, while allowing Checkpoint users to continue using it within the context of a collaboration session 🚀What's cool about this, is that users can create independent checkpoints, which track not only there own changes, but also those coming from other participants in a Live Share session (which enables real-time co-editing). This enhances the pair programming experience, and allow devs to create checkpoints, without needing to rely on Git commits to do it.
In detail, this PR makes three key refactorings:
Use
Uri.toString()as opposed toUri.fsPathorTextDocument.fileName, since the later two APIs strip theUri's scheme, which removes thevsls:portion that is critical for Live Share.Use
Uri.parse()as opposed toUri.file(), since the later always appends thefile://scheme to the parseUri, as opposed to parsing the provided string, and respecting its scheme (if there is one)Using the overload of
workspace.openTextDocumentthat provides aUriinstance instead of a string, since when providing a string, it internally callsUri.file()to parse it, which then runs into problem Adding support for Visual Studio Live Share #2.Long-term, there may be some additional capabilities that would be cool to explore, as Live Share adds some extensibility points (e.g. allowing opting-in to syncing checkpoints, auto-creating checkpoints when editing a file within a Live Share session, etc.). This is an awesome extension, and so I'm keen to see it support Live Share collaboration 👍
// CC @micnil