18

I have a great many extensions, and on any given project, I find myself using maybe a third of all of them (If I'm working on a Python project, I don't really need JavaScript-related extensions now do I?). The problem is that right now VS Code loads and enables every single extension installed at the start of each new project. I find it a pain to then have to manually go and disable all the extensions I won't be needing for the project.

Is there a way to setup VS Code to only enable certain extensions when opening a new folder / workspace? I couldn't find anything in the docs on that subject and when looking at the extension section of the preferences I couldn't find such a functionality.

starball
  • 20,030
  • 7
  • 43
  • 238
snowfrogdev
  • 5,963
  • 3
  • 31
  • 58
  • Anyone? Bueller? I'd like to know how to do this, too. Or to know why this isn't the way to manage extensions in VS Code... – BobHy Jun 02 '19 at 18:28
  • There is also recommended extensions [see SO answer related to this](https://stackoverflow.com/questions/59529463/is-it-possible-to-install-and-enable-workspace-extensions-in-vscode-with-the-vs). Enabling by default could be dangerous so they are still just a recommendation. – Peter Krebs Oct 05 '22 at 07:10

3 Answers3

19

As of Feb 2023, it is now possible to create different Profiles in VS Code.

A Profile can include extensions, settings, keyboard shortcuts, UI state, tasks, and user snippets. You can customize VS Code for different development scenarios like data science, documentation writing, or for multiple programming languages like Python or Java. If you have different VS Code setups based on workflow such as "Work" or "Demo", you can also save those as different profiles. You can open multiple workspaces (folders) with different profiles applied simultaneously.

The following image demonstrates a folder opened with a Work profile that is customized for a work setup. a folder opened with a Work profile

snowfrogdev
  • 5,963
  • 3
  • 31
  • 58
6

To my knowledge, the best you can do is use the Enable, Enable (Workspace) and Disable, Disable (Workspace) options. Here is how ended up doing this:

  1. Open a new workspace / folder.
  2. Disable all extensions using Disable.
  3. Enable all extension that you want to have enabled in every new project with Enable.
  4. Enable extensions that you only want to use in this particular workspace / folder with Enable (Workspace)

From then on, when you open a new workspace, only the "default" extensions should be enabled. If ever you want to disable one of these "default" extensions in a particular workspace but still want it to be a "default" extension, make sure to use the Disable (Workspace) option.

snowfrogdev
  • 5,963
  • 3
  • 31
  • 58
  • 1
    This does the trick, do you know where the setting for workspace enabled and disabled extensions are stored? – Shikyo Feb 08 '23 at 10:55
  • 1
    [^](https://stackoverflow.com/questions/54917413/how-to-set-which-extensions-are-enabled-when-opening-a-new-folder-or-workspace#comment133016014_56419286) @Shikyo See [this answer](https://stackoverflow.com/a/75711349/438273). – jsejcksn Apr 24 '23 at 21:37
0

The problem is that right now VS Code loads and enables every single extension installed at the start of each new project. I find it a pain to then have to manually go and disable all the extensions I won't be needing for the project.

For new workspaces, VS Code loads by default all extensions that have been enabled on a global (non-per-workspace) basis. So I just take the opposite approach as you: I leave most of my extension disabled by default- except that I expect to use in all my workspaces, and then when I create a new workspace, I just enable the few additional ones that I want enabled for that workspace. I usually also make use of .vscode/extensions.json for extensions that I'd recommend collaborators to use for the project.

starball
  • 20,030
  • 7
  • 43
  • 238