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

json language conflict with jsonc #11

Open
luckydye opened this issue Apr 24, 2024 · 4 comments
Open

json language conflict with jsonc #11

luckydye opened this issue Apr 24, 2024 · 4 comments

Comments

@luckydye
Copy link
Collaborator

So zed has no specific language for .jsonc files, all json files are interpreted as jsonc under "JSON".
Now that the biome extensions uses "json" to interpret json files, we get this stuff:

image

We should probably use jsonc for all json files. Though not sure who is right here.

@luckydye luckydye changed the title JSONC applies to JSON files too json language conflict with jsonc Apr 24, 2024
@ematipico
Copy link
Member

I noticed that too. However, that's the settings zed file, so I suppose zed does the same thing as VSCode.

If you opened another JSON file, you wouldn't have these errors. I suppose we'll have to add a new expectation

@Sec-ant
Copy link

Sec-ant commented Apr 24, 2024

To address potential future language-detection problems, we may want to support using filepath glob patterns and the first line of the file to detect languages just like what VSCode does. We can also learn it from other editors or tools like Prettier.

@luckydye
Copy link
Collaborator Author

I noticed that too. However, that's the settings zed file, so I suppose zed does the same thing as VSCode.

If you opened another JSON file, you wouldn't have these errors. I suppose we'll have to add a new expectation

Yes, but zed actually implies all json files are jsonc, not just the settings files.
I think it would be best to actually have a separate JSONC langauge in the editor to control this.

@silvenon
Copy link

silvenon commented May 13, 2024

FWIW i'm getting similar errors in biome.jsonc file, I guess because Zed doesn't recognize those. In my file_types I configured "JSON": ["json", "jsonc"], which took care of the syntax highlighting, but the didn't resolve the error. I'm not sure if it's related to this.

The error is really confusing because unlike the settings file it doesn't make sense at first, but I suppose the comments later screw it up so that's why the whole thing is highlighted red.

Screenshot 2024-05-13 at 22 24 06

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

No branches or pull requests

4 participants