fix(vscode-web): write settings to User path instead of Machine #664
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
This changes the settings file location from:
~/.vscode-server/data/Machine/settings.jsonto:
~/.vscode-server/data/User/settings.jsonProblem
The module was writing custom settings to the Machine settings path, which has lower precedence than User Remote settings. This meant that if a user had any User settings on the remote, they would override the module-provided settings.
Solution
Write settings to the User Remote path instead. This ensures module-provided settings properly override the user's local machine settings while still allowing Workspace settings to take precedence if needed.
VS Code Settings Precedence (lowest to highest)
~/.config/Code/User/settings.json(local machine)~/.vscode-server/data/User/settings.json✅{project}/.vscode/settings.json{folder}/.vscode/settings.jsonSource: VS Code merges settings in
configurationModels.ts#L1021-L1026, with User Remote overriding User Local inconfigurationModels.ts#L962-L972.Testing
Added tests that: