Microsoft/vscode
在 GitHub 查看Resetting various settings can delete comments from settings.json file
Open
#275,792 创建于 2025年11月6日
configfeature-requesthelp wantedsettings-editor
描述
Does this issue occur when all extensions are disabled?: Yes
- VS Code Version: 1.105.1
- OS Version: Linux x64 6.17.6-1-default
Version: 1.105.1
Commit: 7d842fb85a0275a4a8e4d7e040d2625abbf7f084
Date: 2025-10-14T22:33:36.618Z
Electron: 37.6.0
ElectronBuildId: 12502201
Chromium: 138.0.7204.251
Node.js: 22.19.0
V8: 13.8.258.32-electron.0
OS: Linux x64 6.17.6-1-default
Description:
When going from anything but window.zoomLevel: 0 to window.zoomLevel: 0 via either
- the UI "View/Appearance/Zoom In" or "View/Appearance/Zoom Out"
- or the Keyboard Shortcuts "Ctrl+=" or "Ctrl+-",
the setting disappears from the User settings.json via deleting it's line but also deletes one line above it, should it be a comment or another commented out line.
See attached screenshots of a diff from my settings.json file after resetting the zoom level to 0 via keyboard shortcut "Ctrl+=" (e.g. going from window.zoomLevel: -0.5 to window.zoomLevel: 0):
Steps to Reproduce:
- Start in neutral zoom setting (
window.zoomLevel: 0) - Press "Ctrl+-" to set
window.zoomLevel: -1 - Find
window.zoomLevel: -1in your usersettings.jsonfile - Add a line above the setting with a comment:
// test - Save and close
settings.json - Press "Ctrl+=" to set
window.zoomLevel: 0 - Try finding
window.zoomLevelin your usersettings.json, it is gone (expected) - Try finding your manually added comment one line above it, it is also gone (bug)
Suggestion:
Naive first idea: Allow the window.zoomLevel setting to remain in the user settings.json file, even at value "0".