Skip to content
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

Feedback: json vs jsonc #512

Closed
davidsneighbour opened this issue Feb 21, 2023 · 7 comments
Closed

Feedback: json vs jsonc #512

davidsneighbour opened this issue Feb 21, 2023 · 7 comments

Comments

@davidsneighbour
Copy link

I don't know what JSON parsers this project uses for the configuration file, but sometimes I wish I could add some form of a comment to some of my settings. Having JSONC as a format would enable us to just add some inline comments. I know it looks like a proprietary format, but adding faux elements to my JSON to comment on things feels bloated and false :D

Other formats like YAML and TOML have commenting features.

@michaeltlombardi
Copy link

I would love to be able to use JSONC or YAML as the configuration document language. Much more maintainable for me and I use comments extensively.

@estruyf
Copy link
Owner

estruyf commented Mar 17, 2023

Front Matter uses the parser you mentioned.

You can also add your file association that VSCode should treat your JSON file as JSONC.

"files.associations": {
  "frontmatter.json": "jsonc"
}

I will check if this file association can be added by the extension itself.

@estruyf
Copy link
Owner

estruyf commented Mar 17, 2023

Added the file association in the default configuration of the extension. That way, you don't have to do anything.

Xnapper-2023-03-17-13 12 33

@michaeltlombardi
Copy link

Immediately going to update my repos to use this. It looks like this is scoped to make frontmatter.jsonc "just work" - would be great to get this for the other config files if possible (and happy to add an issue for that if it's considered a different scope).

@estruyf
Copy link
Owner

estruyf commented Mar 17, 2023

In the beta and upcoming version, you can just keep using the frontmatter.json file, no use to update it to jsonc. VSCode will use it as jsonc as I defined to treat frontmatter.json like that.

@michaeltlombardi
Copy link

Ohhh! I misunderstood. That's rad. Similar question though about comments/format in the other files (like in the .frontmatter folder).

@estruyf
Copy link
Owner

estruyf commented Mar 17, 2023

I can add it for any json file in the .frontmatter/config folder as well, makes sense!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants