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

jsonc comment support #972

Open
SebastianJ91 opened this issue Apr 24, 2020 · 10 comments
Open

jsonc comment support #972

SebastianJ91 opened this issue Apr 24, 2020 · 10 comments
Labels

Comments

@SebastianJ91
Copy link

Hi,

would it be possible to add jsonc support for allowing comments?
jsonc is used in some configuration files like Visual Studio Code.
Maybe also json5 would be an topic of interest.

A mode switch between standard json or extended json-features would be needed.

@josdejong
Copy link
Owner

Thanks for your suggestion. There are many JSON dialects. Adding support for them is not on the roadmap any time soon.

See also #658

@Heshmatkhah
Copy link

Hi
ACE editor supports JSON5, Is there any plan to support it?

@josdejong
Copy link
Owner

I've no plans to spend time on that anytime soon myself. If anyone is interested in implementing it we can discuss the details to see if it is feasible (it's an open source project), but I expect it will be a lot of work.

@kripper
Copy link

kripper commented Mar 3, 2024

JSONC with """ multiline strings (a must!)

@artursopelnik
Copy link

+1

@kripper
Copy link

kripper commented Feb 6, 2025

UPDATE: We needed multiline strings """like in Python""". Comments was also useful...but:

Changing the JSON spec is useless if the VS Code syntax highlighting extension doesn't support it.

We finally realized that JSON is not designed for human readability, so we switched to YAML.

But then, YAML didn’t work well with tabs, so we had to create this yaml/pyyaml#804.

In the end, I was deeply disappointed with the world. IMO, a tab is a tab and not some sequence of spaces.

@josdejong
Copy link
Owner

@kripper I've used YAML too but found it hard to use in practice. There are more alternatives though, like JSON5, did you have a look into that?

Here two articles I wrote about JSON alternatives:

@kripper
Copy link

kripper commented Feb 7, 2025

did you have a look into that?

Yes, but there was no decent multiline string support:
json5/json5#52

Use case: have a json with prompt templates. You don't want to change your text line by line to copy/paste into a chatbox textbox input to test.

@josdejong
Copy link
Owner

Ah, I understand. So then I guess you could maybe use TOML or JavaScript. Anyway, I suppose you've tried them all 😅.

@kripper
Copy link

kripper commented Feb 7, 2025

Yes. YAML and TOML are the options.

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

No branches or pull requests

5 participants