onivim / oni2

Native, lightweight modal code editor
https://v2.onivim.io
MIT License
7.84k stars 282 forks source link

Configuration: Configuration comments are lost when config transform is applied #3748

Open bryphe opened 3 years ago

bryphe commented 3 years ago

Repro:

Expected: Comments should be retained in configuration.json Actual: Comments are lost

The issue is that the the Yojson library we use for parsing JSON doesn't have comments as part of the object model, so when we parse the comments are ignored. Then, when we rehydrate, the comments are lost.

There are a couple of possible fixes: 1) Add a primitive to Yojson to represent comment strings / blocks 2) Have a smarter patch-application of changed configuration values, preserving existing structure