Closed rgeorgiev583 closed 7 months ago
@rgeorgiev583 thanks for the bug report, I was not aware of this. However I will not going to fix this issue since this is not a breaking bug. If you are interested in collaboration feel free to take up that task.
We’d need to use a JSON library with features like tomli
for JSON-with-comments to properly support VS Code.
I don’t want this project to get rid of my comments and formatting in my VS Code config.
What’s a “breaking bug”? This makes Yin-Yang incompatible with any VS Code config that uses comments or trailing commas, which is almost all of them.
Duplicate of #84
I managed to reproduce this with the VSCode plugin, where the parsing of
settings.json
file failed. However, I suppose that it would be reproducible with the Firefox plugin as well (which also parses JSON files). When I executeyin-yang -t
from the command line, the following error messages appear:2022-04-16 13:57:39,999 ERROR - src.yin_yang: Error while changing the theme in plugin VS Code
json.decoder.JSONDecodeError: Expecting property name enclosed in double quotes: line 16 column 5 (char 558)
After the firstyin-yang
run, I noticed that there are comments in mysettings.json
file, and the mentioned line and column number matched the//
sequence which begins the first comment. After removing all comments from the file, the same error persisted on the second run. However, now it was on the line containing the closing}
of a JSON object with a trailing comma after its last property:I suppose that is caused by limitations in the
json
Python module. It's up to the author to decide if it's feasible to use another module which supports these syntax features.