vscode icon indicating copy to clipboard operation
vscode copied to clipboard

Explore user profiles

Open miguelsolorio opened this issue 4 years ago • 102 comments

Overview

This issue aims to explore what adding "profiles" could look like in the product. These profiles can be used in education, presentations, or can even be language specific. The explorations should cover being able to setup and switch between profiles. Ideally these profiles should be synced with Settings Sync (if used) so you can use those profiles anywhere.

One idea for settings is to introduce a new settings object like:

{
    "profiles": {
        "demos": {
            "files.autoSave": "onFocusChange",
            "editor.fontSize": 18,
            "editor.tabSize": 2,
            "editor.fontWeight": "600",
            "screencastMode.enabled": true,
        }
    },
    
    "editor.fontFamily": "Cascadia Code",
    "editor.renderWhitespace": "all",
}

The "Demos" profile inherits the current settings a user has and adds additional settings on top of the current ones. Also, when profiles are enabled we will create a "Default" profile where the user can switch back to their default mode.

Related issues

  • Screencast Mode only settings #105226
  • Sync mutliple settings profiles #92393
  • Multiple environment profiles (either per-session or per-window) #57548
  • User profile #53453
  • Enable/disable extensions from config file #40239
  • Local Workspace settings #40233
  • Support "perspectives" like approach in VSCode #95182

miguelsolorio avatar Feb 16 '21 05:02 miguelsolorio

Here's the initial exploration of what profiles could look like, starting with a basic example of setting up a "Demos" profile. In this profile, the user can choose to either start with an empty profile (no settings/extensions) or keep their existing data.

Concept A

This concept shows the entry point from the gear menu, but it could also be enabled via the command palette. I didn't show what extension management looks like (yet) because it requires a bit more thinking.

Kapture 2021-02-17 at 22 11 18

miguelsolorio avatar Feb 18 '21 06:02 miguelsolorio

Concept B

This concepts attempts to re-use the accounts menu in the activity bar and also creates a default profile and reduces the effort involved with creating/switching accounts.

Kapture 2021-02-18 at 09 00 38

miguelsolorio avatar Feb 18 '21 17:02 miguelsolorio

One idea for settings is to introduce a new settings object like:

{
    "profiles": {
        "demos": {
            "files.autoSave": "onFocusChange",
            "editor.fontSize": 18,
            "editor.tabSize": 2,
            "editor.fontWeight": "600",
            "screencastMode.enabled": true,
        }
    },
    
    "editor.fontFamily": "Cascadia Code",
    "editor.renderWhitespace": "all",
}

The "Demos" profile inherits the current settings a user has and adds additional settings on top of the current ones. Also, when profiles are enabled we will create a "Default" profile where the user can switch back to their default mode.

So with this approach if I update a setting in the default profile (say editor.fontFamily) but I want the Demos profile to use the default font instead, it should be overridden with its default value here?

That would also mean that every change made in the default profile is automatically inherited by all other profiles? If the change was intended only for the default profile, all other profiles should be modified to revert that change?

I realize it is probably unlikely someone will have a high number of profiles (but who knows, really?); one way to avoid the revert problem above would be to not inherit from the default profile, maybe only use it as a starting point when a new profile is first created. Of course that also means if I change a setting in the default profile that I do want inherited, I'm out of luck... Maybe this inherit from default profile could be a setting as well?

carlocardella avatar Feb 18 '21 23:02 carlocardella

Maybe this inherit from default profile could be a setting as well

What if it was set up in a similar way to how .eslintrc can "extend" other configurations?

For example, when you create a new profile it starts with an "extends-profile": "default" setting which would mean it always inherits from the default, even if default changes. If you no longer want this behavior just remove this extends setting and this profile would go back to App defaults for everything that's not set for that profile?

This would also allow profiles to extend each other (and maybe even allow people to share them!). To go with OPs example, maybe I have a teaching profile with bigger font/zoom and some parts hidden. But now I start teaching another class in a different language and I want a different set of extensions or maybe a different theme that's better for this language. I could just create a new profile that extends my base teaching profile with just the new settings.

I guess this would still leave the question of "if I change a setting of the 'child' profile, which level of the config do I want it on, this one or the parent?" Maybe it's still best to have no inheritance at all and all new profiles should start with App defaults or duplicate the default at creation.

jjspace avatar Feb 19 '21 16:02 jjspace

Also not directly related to current conversation but the term "Profiles" threw me off at first. I was expecting something along the lines of User profiles like multiple Chrome accounts. Not different configuration sets. I think profiles works but it may be worth thinking of alternatives?

jjspace avatar Feb 19 '21 16:02 jjspace

Yea I did originally play around with the "inheritance" concept, mostly focused on disabling it in a certain profile. The idea of mixing profile sounds interesting but would love to see a use case for it first because it could add some unnecessary complications, like you just described.

In terms of the term "Profiles", this one is tricky because we do also have user accounts where you login for certain extensions (like GitHub or Azure), so we want to make sure those are separated and not mixed. But thanks for this feedback, we'll gauge to see if we get similar feedback.

miguelsolorio avatar Feb 19 '21 18:02 miguelsolorio

I prefer concept B. Looking together with #115641, maybe there is no such strong need for the account manager. I personally never touched it after setting up all my accounts.

However, from these early concepts, I did get how it will resolve all related issues.

  • Can I use different profiles for different Code instance? Will it switch profile automatically when opening a workspace or enter/exit screencast mode?
  • I care more about #40233, what's the priority of profile settings? Will it be like user settings < profile user settings < workspace settings < workspace profile settings?

yume-chan avatar Feb 21 '21 16:02 yume-chan

Another related issue is #95182, which proposes the term "perspectives".

gjsjohnmurray avatar Feb 25 '21 11:02 gjsjohnmurray

Here's the initial exploration of what profiles could look like, starting with a basic example of setting up a "Demos" profile. In this profile, the user can choose to either start with an empty profile (no settings/extensions) or keep their existing data.

Concept A

This concept shows the entry point from the gear menu, but it could also be enabled via the command palette. I didn't show what extension management looks like (yet) because it requires a bit more thinking.

Kapture 2021-02-17 at 22 11 18

This looks very good and easy to use also. B is hard to navigate in my opinion.

LucaGabi avatar Mar 03 '21 09:03 LucaGabi

Hi, would this "user profile" concept work for multiple accounts in vscode itself? For example, I use vscode for personal projects (personal email & GitHub account, this one), but also for work (my employer's msft-based email & work GitHub account), potentially also integrating with a customer's system (e.g. their Microsoft account). However, I want my settings to sync via my personal email (for example), or at least to start both from the same config.

NowanIlfideme avatar Apr 13 '21 12:04 NowanIlfideme

Great ideas! I'm looking for a simple tool that allows me to switch profiles/extensions between my HTML/CSS/JS stack, my Python stack, and my Ruby stack. There's no need for one set of extensions to coexist with the other sets of extensions, and it's really tedious to enable/disable extensions by hand.

For example, when coding Ruby, I don't need ESLint to be enabled as an extension. I would prefer it ESLint just "didn't exist" in that VS Code workspace (not merely be disabled).

There is already an extension that does much of this, Profile Switcher. Unfortunately, it's still in version 0.3.3 and has been since 2019. It appears to be abandonware. It might be buggy, or I might be buggy (PEBMAC), but it seems to have "forgotten" a large number of my favorite extensions. Now I need to do a "hard reset" of VS Code and reinstall them.

https://www.aaron-powell.com/posts/2019-06-28-vscode-extension-for-managing-profiles/

There are articles/blog posts at the links below about how to switch user profiles from the command line. However, this also seems rather tedious. https://dev.to/sulmanweb/vs-code-pro-tip-code-profiles-multi-environment-development-hg2 https://www.reddit.com/r/vscode/comments/c2h4a7/different_profiles/ https://dev.to/jsjoeio/how-to-create-code-profiles-in-vscode-3ofo https://www.freecodecamp.org/news/how-to-create-code-profiles-in-vscode/

Could the VS Code team please consider making this an available option? It could be as simple as taking the existing Profile Switcher code (MIT licensed) and cleaning it up.

RobJacobson avatar Apr 17 '21 06:04 RobJacobson

There's also another extension, "User Profiles," that seems to have been released just a few days ago. https://github.com/cyberbiont/vscode-profiles

RobJacobson avatar Apr 18 '21 04:04 RobJacobson

Any progress on this one?

U-C-S avatar Jul 16 '21 11:07 U-C-S

I simply wanted to add another "User Story" for this feature, as well as a more detailed implementation strategy

Similar to what @RobJacobson said, I'm looking for a way to first and foremost configure profile-specific extension sets.
My use-case:

Working with "writing" tools like LaTeX or markdown is often an involved process, with numerous heavy-weight extensions being required. However, 95% of the time I'm not writing and therefore not using these extensions. Disabling and re-enabling these extensions manually would be a solution, but a very tedious, lengthy and error-prone one.
Switching profiles, including active extensions and settings (e.g. Word Wrap Column in this case), on a per-workspace basis, would be the perfect solution.
Using workspace-specific settings would also be possible, but in this case I'd need to manually "duplicate" these settings if I start a new writing project that is unrelated to the others, and I dislike having multiple folders added to a single workspace :)

What I would suggest is giving us the profile functionality, tied to workspaces, so that we can select a specific profile for each workspace. A "default" profile could be used well, by default, and changing the default profile would cause all workspaces, which use the default profile, to change as well.

This should cover most use cases with a very simple concept that is completely compatible with Concept A (status bar items, like the current git branch or Workspace Trust, are also tied to the workspace).

Chaphasilor avatar Jul 27 '21 12:07 Chaphasilor

For the name of this feature may I suggest 'Environments'.

evandcombs avatar May 12 '22 02:05 evandcombs

Linking to https://code.visualstudio.com/updates/v1_67#_settings-profile

gjsjohnmurray avatar May 12 '22 03:05 gjsjohnmurray

I like to contribute my idea. My idea was to have this as part of a project. Maybe part of extensions.json in .vscode directory.

image extensions.json inside my node.js based project

I believe this is simpler from a user's point of view

picwellwisher12pk avatar May 12 '22 08:05 picwellwisher12pk

I like to contribute my idea. My idea was to have this as part of a project. Maybe part of extensions.json in .vscode directory.

image extensions.json inside my node.js based project

I believe this is simpler from a user's point of view

This idea is awesome

hoa00 avatar Jun 15 '22 07:06 hoa00

Would love to see this as a feature, it's difficult to have so many different stacks in a single editor. The intellisense starts playing goofy if I can't sandbox it down.

Sylk avatar Jun 29 '22 07:06 Sylk

After switching to a different profile it can take a few seconds before all the changes have been applied. It would be good to have a progress indicator. Perhaps a spinner in the status bar item. Or a progress notification, which could perhaps also inform us a seach part of the switchover is being performed.

gjsjohnmurray avatar Jul 04 '22 10:07 gjsjohnmurray

Hi all, the latest Insider release has support for settings profiles. It would be great if you can try it out and provide us feedback through issues or comments in this issue. You can enable this feature in insiders using the setting workbench.experimental.settingsProfiles.enabled.

sandy081 avatar Jul 04 '22 12:07 sandy081

Hey folks 👋🏾 now stumbling upon this issue.

Does this support setting different github accounts per profile?

My use case is that my personal/oss github account is different from my work account. Currently getting around this by using VS Code for work and VS Code Insiders for personal/oss.

Wondering if this is tackled in this effort.

iRoachie avatar Jul 04 '22 13:07 iRoachie

I do not think so, Accounts are handled across profiles.

CC @TylerLeonhardt

sandy081 avatar Jul 05 '22 07:07 sandy081

@iRoachie you'll want to follow along with this issue: https://github.com/microsoft/vscode/issues/127967#issuecomment-1111420554

We'll need that before we can do a "different github accounts per profile"

TylerLeonhardt avatar Jul 05 '22 20:07 TylerLeonhardt

@sandy081 I really like the new profiles it basically solves al my gripes with toggling extensions i could not find a way however to choose profiles from the command line e.g. code --profile profile.code-profile so that i can alias different profiles in terminal. Another thing i would love to see is a global config for settings like theme and keybindings which are mostly independent of different projects. maybe giving multiple profiles and merging could be a solution? code --profile global.code-profile project.code-profile

Kevin-Delnoije avatar Jul 06 '22 17:07 Kevin-Delnoije

It would be very interesting if VS Code came with preconfigured profile settings including official and most popular extensions for the most popular programming languages.

xiaoxi-david avatar Jul 10 '22 05:07 xiaoxi-david

@Kevin-Delnoije Thanks for trying out and providing feedback.

i could not find a way however to choose profiles from the command line e.g. code --profile profile.code-profile so that i can alias different profiles in termina

CLI support for profiles is in progress.

Another thing i would love to see is a global config for settings like theme and keybindings which are mostly independent of different projects. maybe giving multiple profiles and merging could be a solution? code --profile global.code-profile project.code-profile

I see your point and heirarchies in profiles will make them complicated to use and understand. So we will collect more feedback here to understand more about this.

sandy081 avatar Jul 10 '22 15:07 sandy081

I am interested in seeing the user profiles evolving. From a developers point: how is switching between different profiles accomplished in terms of extensions? Assuming you have different sets of extensions there seem to be two options for me:

  1. Are extensions uninstalled, so deleted from disk? This would mean new download on next switch.
  2. Or maybe cached? Maybe just moved away from extensions directory? This way an extensions would be moved in place if selected in user profile.

femto-code avatar Jul 10 '22 17:07 femto-code

I agree with @Kevin-Delnoije in the matter of a few additions necessary in order to make the settings profiles adoptable to one's own use case:

  1. Allow binding a settings profile to a workspace/directory (preferably via workspace/folder settings.json, maybe include the .code-profile there)
  2. Provide a way of having a global configuration i.e. extensions or settings/keybindings that would be independent from profiles (the application-level settings also go here).

femto-code avatar Jul 10 '22 18:07 femto-code

Extensions are not uninstalled or installed (downloaded) during profile switching. It is just loading the set of extensions listed from the profile that is active.

Allow binding a settings profile to a workspace/directory (preferably via workspace/folder settings.json, maybe include the .code-profile there)

Yes, Settings profile are associated to a workspace. Please try out the Settings Profiles which are available in our insiders and give us feedback.

Provide a way of having a global configuration i.e. extensions or settings/keybindings that would be independent from profiles (the application-level settings also go here).

Please help me in understanding your use case here and also how you want to see this in VS Code with existing Settings Profiles feature.

sandy081 avatar Jul 11 '22 12:07 sandy081

@sandy081 Use case would be simple: I have multiple workspaces and don't want to have individual profile settings that I have to maintain separately. I think it would be great to give the opportunity so select what to include in the .code-profile. E.g. if settings are not included then the global settings file in user data dir is used. Another option would be to have an auto merge option. At least global settings would be a must-have for me.

femto-code avatar Jul 11 '22 20:07 femto-code