From 7b13d73648251c25ea77709b1fbecd2716bce9ef Mon Sep 17 00:00:00 2001 From: ray Date: Wed, 8 Sep 2021 22:23:35 +0100 Subject: [PATCH] add treesitter highlights --- after/queries/css/highlights.scm | 18 ++++++++++++++++++ after/queries/ecma/highlights.scm | 0 after/queries/html/highlights.scm | 17 +++++++++++++++++ 3 files changed, 35 insertions(+) create mode 100644 after/queries/css/highlights.scm create mode 100644 after/queries/ecma/highlights.scm create mode 100644 after/queries/html/highlights.scm diff --git a/after/queries/css/highlights.scm b/after/queries/css/highlights.scm new file mode 100644 index 0000000..7fa2000 --- /dev/null +++ b/after/queries/css/highlights.scm @@ -0,0 +1,18 @@ +(id_selector (id_name) @CssIdentifier) +(id_selector (id_name)) @CssIdSelector +(tag_name) @HtmlTagName + +(class_selector (class_name) @CssClassName) +(selectors (pseudo_class_selector (class_name) @cssPseudoClass)) +(nesting_selector) @cssNestingSelector + +; need to find out how to make this more specific? +(universal_selector) @CssUniversalSelector + +((property_name) (_)) @CssProp + +(unit) @CssUnit + +(declaration (property_name) (_) @CssPropertyValue) + +(media_statement (feature_query (feature_name) @cssMediaFeatureName (_ (unit) @cssMediaQueryValueUnit) @cssMediaQueryValue) @cssMediaQuery) diff --git a/after/queries/ecma/highlights.scm b/after/queries/ecma/highlights.scm new file mode 100644 index 0000000..e69de29 diff --git a/after/queries/html/highlights.scm b/after/queries/html/highlights.scm new file mode 100644 index 0000000..2b752d4 --- /dev/null +++ b/after/queries/html/highlights.scm @@ -0,0 +1,17 @@ +(start_tag + (attribute + (attribute_name) @ClassNameAttribute (#eq? @ClassNameAttribute "class") + (quoted_attribute_value + (attribute_value) @CssClassName ))) + +(start_tag + (attribute + (attribute_name) @IdAttribute (#eq? @IdAttribute "id") + (quoted_attribute_value + (attribute_value) @CssIdentifier ))) + +(start_tag + (attribute + (attribute_name) @DataAttribute (#match? @DataAttribute "^data-") + (quoted_attribute_value + (attribute_value) @DataAttributeValue )))