1# JSON
2
3JSON support is available natively in Zed.
4
5- Tree Sitter: [tree-sitter/tree-sitter-json](https://github.com/tree-sitter/tree-sitter-json)
6- Language Server: [zed-industries/json-language-server](https://github.com/zed-industries/json-language-server)
7
8## JSONC
9
10Zed also supports a super-set of JSON called JSONC, which allows single line comments (`//`) in JSON files.
11While editing these files you can use `cmd-/` (macOS) or `ctrl-/` (Linux) to toggle comments on the current line or selection.
12
13## JSONC Prettier Formatting
14
15If you use files with the `*.jsonc` extension when using `Format Document` or have `format_on_save` enabled, Zed invokes Prettier as the formatter. Prettier has an [outstanding issue](https://github.com/prettier/prettier/issues/15956) where it will add trailing commas to files with a `jsonc` extension. JSONC files which have a `.json` extension are unaffected.
16
17To workaround this behavior you can add the following to your `.prettierrc`
18
19```json
20{
21 "overrides": [
22 {
23 "files": ["*.jsonc"],
24 "options": {
25 "parser": "json",
26 "trailingComma": "none"
27 }
28 }
29 ]
30}
31```
32
33<!--
34TBD: JSONC Example for how to use `file_types`
35TBD: Add formatter (prettier) settings (autoformat, tab_size, etc)
36TBD: Document JSON Schema features of Zed
37-->