-
Notifications
You must be signed in to change notification settings - Fork 29.8k
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
Ability to use and override default profile settings in a custom profile #188612
Comments
Use case: #156144 (comment) |
I have recently updated my approach towards maintaining my vscode settings.
Pain PointsThese are marked with red arrow
|
Would love to do that as well. I frequently need to enable the same extensions for new (temporary) workspaces. |
The use case I envision is for team sharing of settings. I want to create base default settings for all my team members which they can easily override if they feel so inclined. Then I want them to be able to use a profile as well on top of this foundation. If I could do that via something like https://learn.microsoft.com/en-us/windows/terminal/json-fragment-extensions that could be nice altho maybe that's overcomplicating it - I just want a single base. |
I believe the solution should be akin ESLint extends, or Ruff extends, or any other similar tool. The current way of using {
"workbench.settings.applyToAllProfiles": [
"editor.codeActionsOnSave"
],
"editor.codeActionsOnSave": {
"source.organizeImports": "never"
}
} Imagine I have this in a Web Profile setting.json: {
"editor.codeActionsOnSave": {
"source.organizeImports": "always",
"source.fixAll.eslint": "always",
"source.fixAll.markdownlint": "always",
"source.fixAll.stylelint": "always"
}
} There is no way for me to override the individual items in the object. Setting values can be of various types. Such merging is well handled by normal settings.json merging between user, remote, workspace settings etc, see https://code.visualstudio.com/docs/getstarted/settings#_settings-precedence. Here is an idea of a better solution: Default Profile "editor.codeActionsOnSave": {
"source.organizeImports": "never"
}
} Web Profile {
"extends": ["Default Profile"],
"editor.codeActionsOnSave": {
"source.organizeImports": "always",
"source.fixAll.eslint": "always",
"source.fixAll.markdownlint": "always",
"source.fixAll.stylelint": "always"
}
} This has several benefits:
If doing this, it would be great if a rename of a profile name also updates |
Thinking more about #188612 (comment), it might even be more beneficial to create this So let's say you have |
I wonder with current solution, when create new profile from default with settings, does it simply copy settings or references them from default? |
I believe it references them. |
I wholeheartedly agree with @thernstig on #188612 (comment): this is the way I would expect the system to work, given my experience with various configuration files that follow the same logic. I would like to propose the idea of multiple inheritance (with the settings being merged in order, i.e., the latter one overwriting the earlier one). This would allow you to truly separate different contexts and environments. You could have profiles for each language and context, stacking them just like you stack your tech stack: {
extends: ["Svelte Profile", "Python Profile"]
// Svelte frontend with Python backend specific settings here
} graph TD;
golang(Golang)
svelte(Svelte)
python(Python)
edu("Presentation (larger fonts, etc.)")
svelte & golang-->c1[Svelte frontend with Golang backend]
svelte & python-->c2[Svelte frontend with Python backend]
In this approach, a profile becomes an expression of extensions and settings you'd like to have available when working in a specific context or using a particular technology. It's like knowing you're heading to the gym and doing groceries afterward: you simply grab your sports bag and wallet, and the union of these allows you to do all your activities without having to think too much about what's inside either of them. To avoid having to set up a jungle of profile combinations, it makes sense to specify this union in your workspace file, as the combinationary aspect is typically specific to the workspace. While this idea might extend beyond the initial scope of what this system was intended for, I think it offers the most flexible and (for a lot of developers) familiar approach. |
@soimon yes, multiple inheritance is captured in #188612 (comment) since the example uses an array for extending. However, I think I make a fair point in #188612 (comment) that this should possibly not go into the settings.json but rather Profiles directly. |
@tanishqmanuja when you switch to a profile you have to reopen the settings file because VS Code will keep the previous settings file open. I always add a comment at the top of all my settings file to quickly know which one I'm currently modifying. The Your setting won't be recognized if you don't have this specific extension enabled in the current profile you selected. |
@jmevel, Actually I dont want to switch profile at all here ( bc state of profiles is currently a mess ofc ). What I am doing is making my default profile installing all essential extensions and then disabling them as soon as they are installed. I only enable the required extension for the workspace, for example rust analyzer for rust workspace. |
The current solution is not in the best shape, as key aspects like overriding and sync between machines seem to not behave in a great way, but let's stay positive it changes in the future with our feedback :) I made a smaller summary here of some problems: #196718 (comment) |
Oh I see, that's a smart workaround, I didn't even think of it 😅 |
Hi! 😊 What is the status of this feature? Has a decision already been made? If not, what exactly is missing for a decision? Many of my colleagues and I would be very happy if this feature would be implemented in VSCode. |
Hi @sandy081 😊 |
@PierreLouisPAUGAM FYI the team is focused on endgame this week and next week. |
This is not in our plan yet. |
I found myself here after looking for a way for my profiles to inherit from a default profile. I hate having to constantly remember that some new extension I found in one profile now has to be installed in all my other profiles, and then I have to switch profiles to keep it up to date. A pretty common use case, I would argue, is markdown. Most people have to write markdown regardless of which language or development environment they work with. There are a lot of really good markdown extensions out there for mermaid, automatic link tables of contents, printing as PDF, etc. Another would be GitLens. It adds many features to the Source Control panel that are applicable regardless of language, dev tools, etc. It would make sense to have a base profile hold GitLens and all the markdown extensions I like, and then, as others have mentioned, add/remove based on the framework, development environment, language, etc. |
@dallenbaldwin are you aware that extensions can optionally be installed for all profiles? https://code.visualstudio.com/docs/editor/profiles#_apply-an-extension-to-all-profiles |
Ah! I've never noticed that before! Thank you 😁 Does it also apply that extension to new profiles or is it only another way to copy the extension to all current profiles? |
This should be easy enough to check. Also relevant is #193446 which is milestoned for the current iteration. |
1 similar comment
This should be easy enough to check. Also relevant is #193446 which is milestoned for the current iteration. |
I have been looking for a feature like this for a while now. The way I would apply this feature is that I would create some sort of "base" profile that all profiles will inherit from so it can then serve as a sort of essentials bundle that i would apply to all profiles no matter what the profile is created and used for. This would make it a lot easier if i would find a new extension that has to be set up in a specific way so I don't have to copy paste those settings across all profiles. This would also apply to keybinds and other profile related settings. |
@dallenbaldwin |
Ability to use and override default profile settings in a custom profile
NOTE: Please mention your use case / scenario (NOT how you want to use) for this requirement. Also try if available Profiles features including #156144 are helping
The text was updated successfully, but these errors were encountered: