From 47841b3f8ececdf53d4264037e4a50d6c128f039 Mon Sep 17 00:00:00 2001 From: Max Brunsfeld Date: Thu, 17 Oct 2019 15:04:35 -0700 Subject: [PATCH] Add queries for syntax highlighting (#12) * Add queries for syntax highlighting * :fire: property sheets --- package.json | 1 - properties/highlights.css | 26 -------- properties/injections.css | 9 --- queries/highlights.scm | 10 +++ queries/injections.scm | 7 ++ src/highlights.json | 137 -------------------------------------- src/injections.json | 62 ----------------- 7 files changed, 17 insertions(+), 235 deletions(-) delete mode 100644 properties/highlights.css delete mode 100644 properties/injections.css create mode 100644 queries/highlights.scm create mode 100644 queries/injections.scm delete mode 100644 src/highlights.json delete mode 100644 src/injections.json diff --git a/package.json b/package.json index 32759c6..49a4218 100644 --- a/package.json +++ b/package.json @@ -29,7 +29,6 @@ "file-types": [ "html" ], - "highlights": "src/highlights.json", "injection-regex": "html" } ] diff --git a/properties/highlights.css b/properties/highlights.css deleted file mode 100644 index 202bf1b..0000000 --- a/properties/highlights.css +++ /dev/null @@ -1,26 +0,0 @@ -@import "./injections.css"; - -tag_name { - highlight: 'tag'; -} - -/* TODO - highlight as an error? */ -erroneous_end_tag_name { - highlight: 'tag'; -} - -doctype { - highlight: 'constant'; -} - -attribute_name { - highlight: 'attribute'; -} - -attribute_value { - highlight: 'string'; -} - -comment { - highlight: 'comment'; -} diff --git a/properties/injections.css b/properties/injections.css deleted file mode 100644 index 36d8657..0000000 --- a/properties/injections.css +++ /dev/null @@ -1,9 +0,0 @@ -script_element { - injection-language: 'javascript'; - injection-content: child(this(), 1); -} - -style_element { - injection-language: 'css'; - injection-content: child(this(), 1); -} diff --git a/queries/highlights.scm b/queries/highlights.scm new file mode 100644 index 0000000..c7e4d0d --- /dev/null +++ b/queries/highlights.scm @@ -0,0 +1,10 @@ +(tag_name) @tag +(erroneous_end_tag_name) @tag.error +(doctype) @constant +(attribute_name) @attribute +(attribute_value) @string +(comment) @comment + +"<" @punctuation.bracket +">" @punctuation.bracket +"