From 6876f923d5076ac3abe7da3d1459d7cf162eee00 Mon Sep 17 00:00:00 2001 From: Vladyslav Karasov <36513243+cotneit@users.noreply.github.com> Date: Mon, 6 May 2024 18:11:09 +0300 Subject: [PATCH] lang(json): make field key highlighting consistent with toml and yaml (#10676) --- runtime/queries/json/highlights.scm | 3 ++- runtime/queries/json5/highlights.scm | 23 ++++++++++++++++------- 2 files changed, 18 insertions(+), 8 deletions(-) diff --git a/runtime/queries/json/highlights.scm b/runtime/queries/json/highlights.scm index 6df6c9ebc..17bb5f75b 100644 --- a/runtime/queries/json/highlights.scm +++ b/runtime/queries/json/highlights.scm @@ -4,8 +4,9 @@ ] @constant.builtin.boolean (null) @constant.builtin (number) @constant.numeric + (pair - key: (_) @keyword) + key: (_) @variable.other.member) (string) @string (escape_sequence) @constant.character.escape diff --git a/runtime/queries/json5/highlights.scm b/runtime/queries/json5/highlights.scm index 4bf03fe31..3ec4ee296 100644 --- a/runtime/queries/json5/highlights.scm +++ b/runtime/queries/json5/highlights.scm @@ -1,11 +1,20 @@ -(string) @string - -(identifier) @constant - -(number) @constant.numeric - +[ + (true) + (false) +] @constant.builtin.boolean (null) @constant.builtin +(number) @constant.numeric -[(true) (false)] @constant.builtin.boolean +(member + name: (_) @variable.other.member) +(string) @string (comment) @comment + +"," @punctuation.delimiter +[ + "[" + "]" + "{" + "}" +] @punctuation.bracket