-
Notifications
You must be signed in to change notification settings - Fork 29.2k
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 Settings for Multi root workspaces #28538
Comments
…e into a single service implementation
- Create a simple workspace context service for standalone editor - Use the test context service for tests
- Refactor configuration services to read settings from multiple folders - Implement merging strategy for multi root workspace settings - Implement a configuration model that can be reused across layers - Implement getRoot API in workspace context service
Configuration editing (internal API) takes now
Given a resource scope, following is the support
|
@Microsoft/vscode Here is the strategy of how settings are applied in a Multi-root workspace. ClassificationIn a multi root workspace, settings come from following locations
How does settings coming from a Folder are applied? We cannot apply folder settings on a workbench level because, a setting can have a value in several root folders and it is not obvious to pick a value. Hence, we classified settings into following scopes
Folder scoped settings are subset of Workspace scoped settings. It means Look up StrategyWe follow bubble-up strategy to fetch a value of a setting. Here is the bubble up walk through order we take for Folder Scoped SettingFolder -> Workspace -> User -> Default. We first look for the setting in Folder settings, if found we take that value. Otherwise, Workspace Scoped SettingWorkspace -> User -> Default. We first look for the setting in Workspace Settings, if found we take that value. Otherwise, Merging StrategyWhile looking for a value of a setting using bubble-up strategy, we merge following value types, if settings are defined at multiple locations. Other value types are just overridden (Implies, we take value as it is)
Object Merging StrategyExplained by following example. Let's assume a setting Workspace:
Folder:
After merging
Questions1. Where are Workspace settings defined currently? 2. What settings are scoped to Folder currently?
3. How to define a Folder Scoped setting? 4. How about Debug and Task configurations? 5. Can we define a Folder scoped setting at Workspace level? 6. What are the changes to Single Root Workspace scenario? 7. Can you explain how an editor setting is applied when files from different root folders are opened? Default:
Folder A:
Folder B:
Line numbers are RELATIVE when a file from Folder A is opened. Folder B:
Line numbers are ON when a file from Folder B is opened. 8. How about language overrides behave in different folders? Please provide your opinions and feedback. Thanks. |
So to expand on your example in 7, Folder A:
Folder B doesn't override either of these, so the result will be
Will it be confusing for some settings to not be inherited? Do you know how a setting will be marked as folder scope for the user?
|
@sandy081 good write up 👍 . Your example in 7. makes sense to me but I am unsure how to implement that with our current setup of having a master folder containing the workspace settings. Today we use the master folder as the container of workspace settings:
So, your example is not clear to me if Folder A is the first root folder containing workspace settings. In that case I would assume that Folder B is getting the following setting if it does not define it:
Because that is what Folder A ( = workspace settings) defines. |
After talking to Sandeep, I agree it makes sense to ignore folder settings for now if they appear in the first root folder. We need to think about a new concept of workspace settings when in multi root environment. |
@roblourens Yes agreed, that it is not easy for users to know what is folder scoped and what is not. We need a nice UX story to make it look simple for Users. |
This is an umbrella item for support Settings for Multi root workspaces
The text was updated successfully, but these errors were encountered: