-
Notifications
You must be signed in to change notification settings - Fork 29.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Multiple environment profiles (either per-session or per-window) #57548
Comments
(Experimental duplicate detection) |
Checked: This is not simply a dupe, but a more meta-bug |
@indrora you can enables / disable extension per workspace. |
Enabling and disabling deeply integrated extensions (e.g. platformIO) on a per-workspace basis hinders a lot of things, leaves vestigial messes that take a reload to clean up. Let's say I have PlatformIO installed, open workspace that doesn't want it (i.e. wants the Arduino extension installed). PlatformIO has already taken up a lot of resources and has popped a tab, etc. PlatformIO then has to be rather unceremoniously removed, the window reloaded a few times, and then everything works. I'd love to pop the pallete open and say "New Window With profile" and there, a window (even if it's a whole new instance of Code) pops with only the extensions for Arduino. My current workaround is to use Portable Code and batch files that start the environment I need. There's a huge amount of overlap and duplicates, but I can at least fix PlatformIO causing my startup time to be in the minutes. |
@indrora Not all extensions are like PlatformIO extensions and an extension should not do any thing (activate, install or create files) if the opened workspace has nothing to do with that extension. You can also disable this extension completely and enable the extension on a workspace you want? Issue with the pop up approach is that you always have to specify the extensions you want to run. But if you configure (enable/disable) extensions per workspace, the enabled extensions run in that workspace irrespective of how you opened it |
The idea here would be that in your user configuration you can have
I pull up the palette and type "Select extension profile notes" or "new window with profile notes" and boom, a new window with the extensions from the set notes and from default. Or, I could call |
I think you are mistaken with the term workspace here.. Every VS Code window with a folder or multiple folders is called workspace and it does not matter if it is a main repo or sub repo. If I understand correctly, you requirement is ability to open VS Code window with a given set of extensions? If so, this can be provided from CLI and also may be as a command in Command Pallette. But out of the box support will be that you have to provide the list of extensions instead of the profile. One can come up with an extension on top of it to provide support for profiles. |
Thanks to @sandy081 for pointing me here. But currently, this is mandated just because we do have projects of other types as well. (list management issues) I know vscode isn't supposed to be a full blown IDE and I like this extensions based approach. But I think the current tools for managing extensions are not enough. Extension Packs are out there but they still dump other entries in the list. Transparency: 👍 Awesome, Readability: 😕 not so good. At the very least, let us make folders in the extensions view, just beside 'Enabled', 'Disabled' and 'Recommended', with support for 'enable all in folder' and 'disable all in folder' |
@makeway4pK @sandy081 This feature for vscode has been questioned for almost 2years. Many issues have been closed because it‘s like another, but when you open the linked issue, you'll find out the same, closed. |
The MODE setting is a good way of explaining the feature we're requesting. It'd be better if they(devs) take care of this before the new Settings Sync feature is pushed to stable. |
The new Setting Sync feature is very similar to an extension "Settings Sync"(shan.code-settings-sync). I use it to synchronize my vscode setting, extensions, ...etc. But it didn't solve the problem. For example, I opened 2 vscode window, one for JavaScript, another for PHP, there comes the problem, some extensions will affect two languages, such as code intellisense. So, I wanted that the MODE setting. Developers decide what extension is including in the mode. |
This would be great to have. I currently switch between JS/React projects and Flutter and there are a load of extensions that I need for each project type. Be great if they could be activated deactivated by workspace - with the ability to associate a workspace with one or more project types (JS/PHP/Flutter etc). Also a third group of extensions that always activated for every project type - like sort line extensions etc. |
I don't know about the config file but its good that it won't conflict with this. This issue was marked 'under discussion' so let's have some. @sketchbuch , any ideas? Something that might be unique to your workflow, how do you imagine this feature? And @indrora , how do you use tools from both PlatformIO and Arduino i the same project? I tried and failed, too much interference between them. |
I would like to be able to associate extensions with different "technologies"/"modes" or whatever you want to call them. And then just associate a workspace with one or more technologies. Extensions can be enabled/disabled already on a workspace basis so all we need is some kind of configuration for deciding what to enable/disable. And to reduce security isssues I would maybe just enable/disable extensions not automatically install new ones - that I think should still be manually done by the user. Maybe when an extension is installed the extension editor tab updates to display a list of checkboxes for each of the technologies created by the user (flutter/js in my case) and you could just checkmark each extension that way - then no new interface needs creating to manage this configuration as the extension list already show this detail page for each extension. The only thing that would need some kind of new setting would be the names of the technologies themselves - could just be a string array. Then vscode could just activate/deactivate extensions when you open a workspace. If the vscode team do not want to do this, just allowing the extension API to enable/disable extensions for the current workspace only would allow third parties to create an extension to manage the "technologies" and activate/deactivate extensions upon workspaces being opened |
I mean the feature Setting Sync may have a config file to store something useful. Yep! It won't conflict with this. @sketchbuch |
Hi @makeway4pK , But my need isn't about syncing extensions, it is about having a consistent set of extensions for different technologies. I have about 40 workspaces at the moment about 10 for Flutter the rest JS/React. If I install a new extension for flutter development I need to disable it manually in each JS workspace when I next open it. What I want is a way to automate this, not just install extensions for a specific technology if not installed already. |
@sketchbuch |
The arrow pointed to some extensions I removed in this dir. |
Hi @kekexunxun, after more playing around I ran into inconsistency issues so I deleted my comment above. This needs more tesing for sure. |
Same here 😅 I was just trying to think from the devs' point of view. The functionality of the extension 'Settings Sync' mentioned by @kekexunxun is coming to vscode natively (See: https://code.visualstudio.com/docs/editor/settings-sync) with Microsoft account or Github account as the cloud options and it is being currently previewed in the insiders release. There's some granular control over the settings/extensions you want to sync/ignore. But there's no mention or idea of multiple sets/modes/technology-groups of extensions in its roadmap. So I suggested that this feature might be taken care of along with the big one that is already out. |
I think the MODE (or as I call it PROFILE) is the best option. Currently we have the options Enable/Disable (Workspace), we could have the PROFILE set per project, and the profiles as a config entry, like: "extensions.profiles": {
"javascript": {
"extensions.profiles.enabled": [
"xxx.yyy",
...
]
},
"PHP": {
"extensions.profiles.enabled": [
"xxx.yyy"
]
}
} And, when a PROFILE is selected (which could not be the case, so the current behavior is de DEFAULT profile), there could exist an option in the extension menu like Enable/Disable (Profile). |
@bkmeneguello so far, I have to close some extension manually when I changed from PHP to Javascript or something sort like this. Whether it will be called Profile or Mode, I'd better like it will be mentioned in the feature Publish Version Notes. Experiment or not, no matters. This can be a profile, vscode config, etc. Once you configured it, VSC will enable all extensions which existed and included. |
While I don't think this feature will be implemented soon, is there any config file that saves the enabled/disabled states (global and workspace-specific) for these extensions? I could write a simple parser script with a console UI to toggle the extensions by groups without needing to use the vscode UI. Tag me if anyone finds where extension state info is stored. Hopefully it's in plaintext. |
I tried to use a new extension to manage other extensions.
{
"extension-setting": {
"enabled": [
"octref.vetur",
"xxxx"
],
"disabled": [
"xxxx",
"xxxx"
]
}
}
The biggest problem is to provide an extension's deactivation method, it may cause other problems, will you consider about it ? @sandy081 |
Extension disablement is not just deactivating the extension, its contributions should be unregistered in the core. So I do not think extension can do this correctly. |
Dup of #116740 |
Thanks a lot. I use extension workspace solved my problem, thought it needs to be initialized when new projects opened. |
VS Code is awesome, and others have taken a liking to it as well. So much so that whole IDEs are being built on top of extensions (such as PlatformIO, vs-code-arudino, Flutter, etc.)
What this means is that I typically have VS Code open three/four times (e.g. one for PlatformIO, one for Arduino, one for Python). While it's awesome I can hotswap between them, PlatformIO makes some changes to the UI that only make sense to it (e.g. there's a virtualenv I didn't realize I was in and was wondering why Python3 sources were being interpreted as Python2.7)
There's also occasionally extensions that conflict with one another -- For instance, the PlatformIO plugin just does not play well with the Arduino plugin, both try to take over parts of the interface in different ways.
There's already setting,
--extensions-dir
and--user-data-dir
in combination, that lets you swap what directory extensions are loaded from. I'm more asking "Can I have per-window choices of extensions?" Barring that, a simple way to declare an extension-set and fire up Code with that?The text was updated successfully, but these errors were encountered: