-
Notifications
You must be signed in to change notification settings - Fork 19
keys are missing from settings.json after profile load, all comments are deleted #26
Comments
Im having the same issues, it seems to be working fine except that it doesnt copy over "some" keys. And these keys and their contents are correctly saved within the profile (i can see them saved inside the profile text) Its just that they are not appended back into the user settings page... "files.exclude": {
"**/Icon?": true
},
"workbench.colorCustomizations": {
"activityBar.activeBackground": "#294A5B"
},
"editor.tokenColorCustomizations": {
"strings": "#97bf6e",
"functions": "#b8bec9",
"keywords": "#B182D1",
"textMateRules": [
{
"name": "Variables",
"scope": "variable.other.readwrite",
"settings": {
"foreground": "#b8bec9"
}
},
{
"name": "Variables-level1",
"scope": "support.variable",
"settings": {
"foreground": "#E0C084"
}
},
{
"name": "Variables-level2",
"scope": "variable.other.object",
"settings": {
"foreground": "#6FACE6"
}
},
{
"name": "Variables-level3",
"scope": "variable.other.object.property",
"settings": {
"foreground": "#b8bec9"
}
},
{
"name": "Calc operators",
"scope": "keyword.operator",
"settings": {
"foreground": "#b8bec9"
}
},
{
"name": "Regex",
"scope": "string.regexp,constant.other.character-class.regexp",
"settings": {
"foreground": "#97bf6e"
}
}
]
},
I really want to use the Profile Switcher extension since i have about 90 extensions but need most only in certain scenarios. Until 100% of my settings are saved/applied correctly im going to have to pass for now :( |
Stay tuned. I have wrote my own VS Code extension for profiles switching that takes another approach. It will be probably released soon enough once I will have time to polish it and publish it. |
Hope life has been treating you well during these times, any update on the proposed extension? :) |
Sorry to keep you waiting, I had really no time for this lately. |
I'm having similar issues to @WybeBosch. Particularly I'd like to see workbench.colorCustomization settings brought in. Saving a profile saves the colors in the profile object, but they're not applied when switching to the profile. I'm using the Peacock extension and this would pair really well if those colors would work. |
Comments are actually really hard to deal with. They aren't valid JSON, which means that you can't just treat the stuff as normal JSON and JavaScript objects, you have to get a parser that understands the comments, can handle them, can do inserts into locations and keep the comment structure in place (if there's a multi-line comment, you don't want to insert in the middle of it do you). I do use I'd assume that VS Code does something different with that library (I think it's what they use), but I haven't had the time to work out how they handle files with comments, especially reading/writing them. My guess is they don't treat them as JSON at all, they use an AST of some form. |
Lost keys shouldn't happen though, unless the key is invalid JSON, so if someone can share a |
@WybeBosch |
@cyberbiont my dude you are amazing! I will check it out! |
If I get it right, setting.json handling is done via "additive" approach and all of the changes should be piled up, but nothing should be deleted.
However, after saving and immediately loading profile:
I don't know how merging is done on settings.json, but something is wrong with it.
The text was updated successfully, but these errors were encountered: