Closed luckydye closed 2 months ago
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
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.
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.
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.
Any forecast on this matter? I wanted to switch to Biome in Zed and VSCode :)
There's nothing much to do. You'll have to use a configuration file, and enable JSONC features in the parser options
Or... Zed could add the support for JSONC and we could enable the default formatter for those instead of Biome... without having to create a config file for every project :)
Feel free to file an issue in their repository
So apparently it's gonna happen :)
Is fixed in Zed 0.143.0
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:
We should probably use jsonc for all json files. Though not sure who is right here.