Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
PR Type
This PR is a proposed solution for integrating Visual Studio Live Share extension with Live Server extension that'd help to automate sharing a server in a collaboration session.
[ ] Bugfix [x] Feature [x] Refactoring (no functional changes, no api changes) [ ] Documentation content changes [ ] Other: <!-- Please describe: -->
What is the current behavior?
This solution is a significant improvement in user experience as of today a user sharing a workspace in VSCode needs to share Live Server manually through the interactive flow every time.
What is the new behavior?
With the new flow, upon the collaboration session start Live Server sends a request to share a live server. In response to the request, VS Live Share notifies the host user and requests their permission to start sharing the server.
When the host user clicks the Allow button all participants in the collaboration session get access to the shared server.
Does this PR introduce a breaking change?
Other information
Implementation Details
VS Live Share provides extensibility API allowing consumers to subscribe to collaboration session events and invoke methods to share/un-share artifacts in the active collaboration session. To help to manage live server sharing state I've introduced
LiveShareHelper
class that receives notifications fromAppModel
and VS Live Share API.To decouple the helper from the model I've extracted
IAppModel
interface with two new eventsGoLiveEvent
andGoOfflineEvent
.Misc
As
tasks.json
version0.1.0
has been deprecated I upgraded the default build task definition to version2.0.0
using a recommended task template.