-
-
Notifications
You must be signed in to change notification settings - Fork 54
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
VSCode settings.json Completely Overwritten #84
Comments
Well, that should not have happened. It's likely there was an error while trying to read your settings file, since only then an empty settings file gets created (see this line here). So you should probably check if it is well formed, e.g. no missing brackets. Could you please replicate the issue by doing the following:
|
This reproduces the issue and overwrites the file. But my I have the dark theme set to "Atom One Dark" and the light theme set to "Atom One Light" in the VS Code section of Yin-Yang. I'm also running on the AUR version of the app -- v2.1 |
Interesting. Seems like the inplace_change() function is the issue here. Good news is that in my pull request, VS Code doesn't use this function anymore, bad news is that other plugins still use it. I'm going to investigate this further. |
There may be a safer function to read the json. The SO post above has a solution with |
I actually don't think that this a good idea, since Instead, I think there should just be an exception if the file is malformed and do nothing else. Does VS Code automatically form the JSON files in such a way or did you manually edit it? If VS Code created those, then it may actually be needed. |
I don't think vscode created any JSON that way by default, but any plug-ins that edit the settings file can theoretically add an extra comma. For example, my settings file's last line was setting my Python virtualenv location. This was added by the Python extension, and it had a comma at the end of it. |
I am having this problem too. My settings got overwritten seemingly randomly for weeks and I couldn't figure out why. I just per chance noticed it was at the same time, when yin yang changes the theme, all settings are deleted. Is there anything that can be done about this? |
I had set Yin-Yang to change the color scheme in VS Code based on time of day, and it appears that it completely overwrote my
settings.json
file with just the color scheme.Yin-Yang needs to either append to, or update the JSON -- not completely overwrite the file. I would have lost years worth of settings accumulating if I hadn't had another computer with my old
settings.json
still intact.Machine configuration:
DE: plasmashell 5.21.5
OS: Manjaro 21.0.6
The text was updated successfully, but these errors were encountered: