From 0d7cbf262699950b9e7dc37461cba6f2be88b85c 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 6df6c9ebcf17..17bb5f75b712 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 4bf03fe31fc2..3ec4ee296cfa 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