From cc195b6a96573ffc73fd13776653f70764ed4108 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6ran=20Karl?= <3951388+JoeKar@users.noreply.github.com> Date: Mon, 19 Aug 2024 22:16:42 +0200 Subject: [PATCH] syntax/json: Add comment support to the syntax highlighting (#3434) * allow comments in json * syntax/json: Add colon to `TODO` comments --------- Co-authored-by: Sertonix <83883937+Sertonix@users.noreply.github.com> --- runtime/syntax/json.yaml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/runtime/syntax/json.yaml b/runtime/syntax/json.yaml index 6d8408333..f69a304bf 100644 --- a/runtime/syntax/json.yaml +++ b/runtime/syntax/json.yaml @@ -25,3 +25,15 @@ rules: - statement: "\\\"(\\\\\"|[^\"])*\\\"[[:space:]]*:\" \"'(\\'|[^'])*'[[:space:]]*:" - constant: "\\\\u[0-9a-fA-F]{4}|\\\\[bfnrt'\"/\\\\]" + + - comment: + start: "//" + end: "$" + rules: + - todo: "(TODO|XXX|FIXME):?" + + - comment: + start: "/\\*" + end: "\\*/" + rules: + - todo: "(TODO|XXX|FIXME):?"