-
Notifications
You must be signed in to change notification settings - Fork 29.5k
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
Support machine-specific settings that can be set (overridden) in workspace/folder #73985
Comments
@DanTup Here is how different scopes work in a remote window
Machine scoped settings are prevented at workspace/folder level because of the reason that machine scoped settings are mostly with paths and having such settings shareable does not makes sense.
How does such settings work when the project is shared as all users might not have same common paths. May I know more about such settings to understand and see what is the right approach to take? |
I think it makes perfect sense, if it wasn't for VS Code not making it easy to not commit them :-) For example, in my global settings I have:
Then I open a project I'm working on that uses new features that I want to use a bleeding-edge SDK for. I override the sdk path in the workspace settings:
This all works fine today (and my extension provides a quick-pick list to quickly switch between SDKs for the current project, which is writes into workspace settings) until you remote. This is good functionality - the only thing that makes it weird is that VS Code doesn't separate workspace settings that we do and don't want to commit (that's what #40233 is asking for). TypeScript has exactly this setup (
Right now, my assumption is that if people put SDK paths in their workspace settings, they would not commit them (or they would be the only people working on their project). This isn't a perfect solution, but until we have something like #40233 it's unavoidable. I actually think #40233 is a better fox for this, if you consider them "machine-specific workspace settings". Eg. put them in settings.machine.json and then people can gitignore them, and you can also ignore them when remoting. |
Good that we share same thinking for solving this. I too agree that the right fix for this is to support local workspace settings. Remote set up adds more weightage for this requirement. Making this dup of #40233 |
Thanks for creating this issue! We figured it's covering the same as another one we already have. Thus, we closed this one as a duplicate. You can search for existing issues here. See also our issue reporting guidelines. Happy Coding! |
Potentially :) I'm sure there are some users that also want local workspace settings that will apply in remotes (for ex. some have extensions that change colours of VS Code to make each workspace distinctive - they probably do want them to apply remotely). I still sorta think that putting |
Is there any example do you think of? |
I was thinking of https://github.com/johnpapa/vscode-peacock, though now I think about it, that's a UI extension that runs in the client, so presumably it would still see the "local workspace" settings even though they're not synced to the server? Or do the same rules apply for which settings are seen for both ends? |
Non shareable workspace settings would be associated to the workspace/folder and they will have same rules as of now except that machine scoped settings will be respected in non shareable workspace settings. |
I'm not sure I understand. Let's say the linked issue above is implemented, and we end up with If I add a) remote running extensions (eg. like my debugger) If the answers are a) No and b) Yes, then I think that satisfies both the needs above. However if they're both the same answer, I think either it won't handle my use case, or won't handle Peacocks :( |
|
I have a setting that is an SDK path. It needs to be:
This is not possible today, and based on your last comment seems it won't be possible even if "local workspace settings" are implemented. In order to do 3 I have to mark the setting as "machine scope", but then 2 doesn't work because VS Code complains if you try to set a machine-scope setting at a workspace level (the validation tells you not to set a machine-scope setting here). I don't understand why a setting can't be machine-scoped if set globally, yet still overridable at a workspace level. |
I think we agreed that non shareable folder settings is the solution for your usecase: A path setting which is recommended to be machine scope:
A common SDK path can be set for all local folders using User settings Even the Peacock extension can configure window specific settings like themes, colors in non sharable folder settings which are associated to the given folder.
It makes sense to be overridable only if the setting is not shared. Sharing a machine scoped setting does not makes sense. Sorry, if I am missing or not understanding some thing which you think that does not work with non shareable folder settings. |
But wouldn't Peacock want those settings to apply when when in a remote session? Eg. I set my color to "red" in the non shareable folder setting for my project, then I open it in a container - I still want it to be read, so the setting still needs to apply (at least in the client)? (My understanding from this comment was that the client and server would always see the same settings, which sounds like Peacocks non shareable color settings would not have any effect when connected to a container?) |
Right, opening a folder on disk locally or in container will have different non shareable settings as they are two different folders with different URIs. I think this limitation is ok and if needed we can think of letting dev container extension syncing these settings (but as said I would not go to that unless really needed). |
Ok, then it sounds like the non-shared settings will work for me if the local/remote won't share them by default. When can we have it? 😆 |
Reopening to bring it up for discussion to allow a machine scope setting to be overridable and sharable. |
I agree that it would be useful to separate the concepts. In microsoft/vscode-go#2576 several settings for Go were changed to be Our current config is mostly turn-key where a dev can check out the repo and get started with VSCode with very few manual steps. Configuring those paths in the User Settings would not only make our developer setup less convenient, but also means that developers can't easily work on multiple Go projects with different configurations. This is a different use-case than #40233 since these are shared settings committed to our repo, rather than being able to provide user-specific overrides (though I would love to see that implemented as well). |
Introducing a new scope
Calling it |
Sounds good to me :-) |
Verify that a configuration contributed with scope
|
Doesn't seem to work for me. Created #79983. I suggest the issue is tracked there, marking as (partially) verified. |
When trying out the remote/container support in Insiders, I noticed some issues caused by my SDK paths being synced from Windows into the container. I saw in 1.24 there's a new
machine
scope for settings that seems like it's designed to fix this.However, many of my paths (SDKs, log files) are
window
-scoped, so that they can be set both global or per-project (for example, you might set an SDK path in user settings, but want to override it for a specific folder).In order to prevent the global user SDK path being synced to the container, we need to change the
scope
fromwindow
tomachine
, however that prevents a (non-remote/container) user from being able to set the SDK at the workspace level (they'll get warnings "This setting can be applied only in user Settings").This doesn't seem very flexible - it seems like we should be able to have settings that can be set both at the user-level (and considered machine-specific) and also at the workspace/folder level (where it's up to the user to manage).
Note: I am not asking for machine-specific workspace settings. If a user chooses to set these settings in the workspace level, it's on them to make sure they work on whatever machine/container they open the settings on. What I think is required is:
I guess it's similar to the
typescript.tsdk
setting, however by coincidence that's usually set to a relative path (node_modules) so the issue isn't as obvious there. If people set absolute paths there, then they'd hit this same issue (if they set it in user settings, it would sync into containers and potentially be wrong, and if it was marked asmachine
, it would no longer be settable at the folder level).The text was updated successfully, but these errors were encountered: