Skip to content
This repository was archived by the owner on Jul 18, 2022. It is now read-only.

Conversation

lostintangent
Copy link
Contributor

@lostintangent lostintangent commented Jul 2, 2019

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.autoSave setting being toggled automatically when starting and stopping a Live Share session:

ProfileSwitcher

@@ -3,49 +3,77 @@ import SettingsHelper from "./settingsHelper";
import ContributedCommands from "./commands";
import Config from "./services/config";
import ExtensionHelper from "./services/extensions";
import * as liveShare from "./services/liveShare";
Copy link
Contributor Author

@lostintangent lostintangent Jul 2, 2019

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).

@aaronpowell
Copy link
Owner

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.

@lostintangent
Copy link
Contributor Author

@aaronpowell Yep, that’s exactly what it does!

@aaronpowell
Copy link
Owner

Neat! I'll look to merge it soon.

@aaronpowell
Copy link
Owner

Well there we go, all checks pass now :)

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

Successfully merging this pull request may close these issues.

2 participants