Repository navigation
Add support for JSONC to dotfiles merge entries #15070
Replies: 1 comment
|
Thanks for the detailed write-up, and for the note about the error message. I opened #15077, which adds JSONC support to [dotfiles]
"~/.config/Code/User/settings.json/shared" = { source = "vscode/shared.json", merge = true, format = "jsonc" }The target is edited in place, so comments, trailing commas and keys you don't own stay as written. The source can contain comments too. A The error you hit also changes: an invalid source now names the file and the parse error, for example AI-assisted — Tool: Claude Code; model: anthropic/claude-sonnet-5-5; version: 2.1.308. |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Hi! I'm trying to move my VSCode
settings.jsoninto my managed dotfiles, using themergefeature. Unfortunately the VSCode devs decided not to follow the JSON standard, so comments and dangling commas insettings.jsontrip Mise up[1].Would it be possible to add support for merging JSONC files? Since the
settings.jsoncase can't be recognized based on the file extension, a manualformatoverride would also be necessary (unless JSON files should fall back to the JSONC parser, but that feels error-prone).Blocks can probably also be made to work because comments are allowed, but the hierarchical nature of JSON still makes this a bit error-prone.
[1]: By the way, I noticed that a
sourcewith invalid JSON causes an error that doesn't actually mention where the issue happens:If the source has valid JSON, but the target doesn't, the error message is much more specific:
All reactions