Bug
The sanitizeId function in settingsTreeModels.ts uses a regex without the g (global) flag:
function sanitizeId(id: string): string {
return id.replace(/[\.\/]/, '_');
}
Without the g flag, String.prototype.replace only replaces the first match. Since settings IDs contain multiple dots (e.g., root.editor.font.size), only the first dot gets replaced:
Input: "root.editor.font.size"
Actual: "root_editor.font.size" // only first dot replaced
Expected: "root_editor_font_size" // all dots replaced
Fix
Add the g flag to the regex: /[\.\/]/g
Location
- File:
src/vs/workbench/contrib/preferences/browser/settingsTreeModels.ts, line 755