From 5e4bdbbcde2aed9d903a51997b674c04f91c3986 Mon Sep 17 00:00:00 2001 From: chbk Date: Fri, 21 Feb 2025 16:59:32 +0100 Subject: [PATCH] Improve JSON syntax highlighting (#25329) Release Notes: - Improved JSON syntax highlighting. | Zed 0.174.6 | With this PR | | --- | --- | | ![Image](https://github.com/user-attachments/assets/46c8ae89-aca1-4756-b66c-78ccd8f3778d) | ![Image](https://github.com/user-attachments/assets/3ba5e5db-1467-40d7-a502-2790feec8ad3) | - `null`: `constant` -> `constant.builtin` - `,`, `:`: `punctuation.delimiter` ```json { "property": null, "boolean": true } ``` --- crates/languages/src/json/highlights.scm | 7 +++++-- crates/languages/src/jsonc/highlights.scm | 7 +++++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/crates/languages/src/json/highlights.scm b/crates/languages/src/json/highlights.scm index c3186af264..1098320ccb 100644 --- a/crates/languages/src/json/highlights.scm +++ b/crates/languages/src/json/highlights.scm @@ -13,9 +13,12 @@ (false) ] @boolean +(null) @constant.builtin + [ - (null) -] @constant + "," + ":" +] @punctuation.delimiter [ "{" diff --git a/crates/languages/src/jsonc/highlights.scm b/crates/languages/src/jsonc/highlights.scm index c3186af264..1098320ccb 100644 --- a/crates/languages/src/jsonc/highlights.scm +++ b/crates/languages/src/jsonc/highlights.scm @@ -13,9 +13,12 @@ (false) ] @boolean +(null) @constant.builtin + [ - (null) -] @constant + "," + ":" +] @punctuation.delimiter [ "{"