From d36d825a075b5c1edf7418904993575cdb51524d Mon Sep 17 00:00:00 2001 From: Martin Jambon Date: Fri, 23 Jun 2023 14:12:34 -0700 Subject: [PATCH] Set up config for 'tree-sitter highlight' and update highlight rules for strings --- package.json | 16 +++++++++++++++- queries/highlights.scm | 6 +++++- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 270b4fb..e6c6ade 100644 --- a/package.json +++ b/package.json @@ -13,5 +13,19 @@ }, "devDependencies": { "tree-sitter-cli": "^0.20.1" - } + }, + "tree-sitter": [ + { + "file-types": [ + "Dockerfile", + "dockerfile", + "docker", + "Containerfile", + "container" + ], + "highlights": [ + "queries/highlights.scm" + ] + } + ] } diff --git a/queries/highlights.scm b/queries/highlights.scm index 5a945fb..7c1bfde 100644 --- a/queries/highlights.scm +++ b/queries/highlights.scm @@ -35,7 +35,11 @@ (image_digest "@" @punctuation.special)) -(double_quoted_string) @string +[ + (double_quoted_string) + (single_quoted_string) + (json_string) +] @string (expansion [