-
Notifications
You must be signed in to change notification settings - Fork 18
[Live Share] Allow developers to specify a profile to use when hosting Live Share sessions #4
Conversation
| import ContributedCommands from "./commands"; | ||
| import Config from "./services/config"; | ||
| import ExtensionHelper from "./services/extensions"; | ||
| import * as liveShare from "./services/liveShare"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Most of the churn in this file are refactorings that allowed the profile selection code to be re-used. I split the selectProfile method into selectProfile (which is the command handler), promptProfile (which handles displaying the UI), and activateProfile (which actually activates the profile).
This allows the Select Live Share Profile command handler to re-use the profile prompting code, without actually activating the selected profile (since it's simply setting a profile for future use, as opposed to immediately activating it).
|
Just the make sure I'm understanding correctly, it will automatically select a profile when you start a Live Share session, and then roll it back once the session ends? That's pretty awesome! My only wonder is how it'll play with extension enable/disable stuff, which, when complete, kind of requires a reload of Code, and that might mess with Live Share running. I'll go through a proper review once I complete the extension stuff I'm working on at the moment. |
|
@aaronpowell Yep, that’s exactly what it does! |
|
Neat! I'll look to merge it soon. |
|
Well there we go, all checks pass now :) |
This PR introduces the notion of a "Live Share profile", which enables developers to automatically switch between profiles when they start a Live Share session. When you're hosting a Live Share session, your editor settings impact all guests in the session (but not your personalization settings!), and therefore, it could be valuable to have a profile that you use for collaboration, which is more amenable to your peers if you collaborate frequently (e.g. turning off auto-save/format on save/etc).
This could also allow activating extensions only when a Live Share session is active, which could be valuable when you want to use extensions that only contribute to Live Share (e.g. whiteboard).
Below is a demo gif that shows the
files.autoSavesetting being toggled automatically when starting and stopping a Live Share session: