What to do about use_air()
and JSON files with comments in them?
#2114
Labels
tooling 🔨
Internal usethis tooling
Uh oh!
There was an error while loading. Please reload this page.
use_air()
modifies asettings.json
file using jsonlite, but #2109 (comment) let us know that jsonlite will fail to parse JSONC (json with comments), andsettings.json
is a JSONC file.This is fairly annoying because it is somewhat common to put comments in a file type like this.
I'm not sure what the right thing for
use_air()
is. Ideally we'd have a parser that supports JSONC, but in the meantime...?Maybe we'd:
settings.json
andextensions.json
if they don't exist, and dump in the template containing what we know we want to put theresettings.json
orextensions.json
if they do exist, and output stuff in the console telling the user what they should add to those files (since we can't reliably do that for them). Opening the file at least makes it slightly harder to miss that you are supposed to do something here, but it is still less optimal than just modifying it for the user.settings.json
orextensions.json
and overwrite it completely with our template for air settings, relying on the user to use git diffs to work backwards from there and re-add anything we removed (merging with the new air settings). This is what we do for github actions workflows, but does feel kind of aggressive hereIt's worth giving this some thought because we are likely going to have other helpers that touch
settings.json
as time goes on and more people use Positron (See #2111 too)The text was updated successfully, but these errors were encountered: