aboutsummaryrefslogtreecommitdiffstats
path: root/runtime/queries/slim
diff options
context:
space:
mode:
authorChristian Clason <c.clason@uni-graz.at>2023-06-12 09:54:30 -0600
committerChristian Clason <c.clason@uni-graz.at>2025-05-12 18:43:40 +0200
commit692b051b09935653befdb8f7ba8afdb640adf17b (patch)
tree167162b6b129ae04f68c5735078521a72917c742 /runtime/queries/slim
parentfeat(c-family): inherit injections (diff)
downloadnvim-treesitter-692b051b09935653befdb8f7ba8afdb640adf17b.tar
nvim-treesitter-692b051b09935653befdb8f7ba8afdb640adf17b.tar.gz
nvim-treesitter-692b051b09935653befdb8f7ba8afdb640adf17b.tar.bz2
nvim-treesitter-692b051b09935653befdb8f7ba8afdb640adf17b.tar.lz
nvim-treesitter-692b051b09935653befdb8f7ba8afdb640adf17b.tar.xz
nvim-treesitter-692b051b09935653befdb8f7ba8afdb640adf17b.tar.zst
nvim-treesitter-692b051b09935653befdb8f7ba8afdb640adf17b.zip
feat!: drop modules, general refactor and cleanup
Diffstat (limited to 'runtime/queries/slim')
-rw-r--r--runtime/queries/slim/folds.scm1
-rw-r--r--runtime/queries/slim/highlights.scm82
-rw-r--r--runtime/queries/slim/indents.scm4
-rw-r--r--runtime/queries/slim/injections.scm39
-rw-r--r--runtime/queries/slim/locals.scm7
5 files changed, 133 insertions, 0 deletions
diff --git a/runtime/queries/slim/folds.scm b/runtime/queries/slim/folds.scm
new file mode 100644
index 000000000..aabc67617
--- /dev/null
+++ b/runtime/queries/slim/folds.scm
@@ -0,0 +1 @@
+(child) @fold
diff --git a/runtime/queries/slim/highlights.scm b/runtime/queries/slim/highlights.scm
new file mode 100644
index 000000000..e219932f6
--- /dev/null
+++ b/runtime/queries/slim/highlights.scm
@@ -0,0 +1,82 @@
+(comment) @comment @spell
+
+(tag_id) @keyword.function
+
+(tag_class) @keyword.type
+
+(injector) @keyword.import
+
+(directive_sign) @keyword.directive
+
+[
+ (string_start)
+ (string_content)
+ (string_end)
+] @string
+
+(bracket) @punctuation.bracket
+
+[
+ "#{"
+ "}"
+] @punctuation.special
+
+(delimiter) @tag.delimiter
+
+(parameter_name) @variable.parameter
+
+(parameter_value) @tag.attribute
+
+[
+ (text_inline)
+ (text_block)
+] @markup.raw.block
+
+; Markup tags
+; https://developer.mozilla.org/en-US/docs/Web/HTML/Element
+(tag_name) @tag
+
+((tag_name) @tag.builtin
+ (#any-of? @tag.builtin
+ "doctype" "html" "head" "title" "base" "link" "meta" "style" "body" "article" "section" "nav"
+ "aside" "hgroup" "footer" "address" "p" "hr" "pre" "blockquote" "menu" "figure" "figcaption"
+ "main" "div" "small" "s" "cite" "q" "dfn" "abbr" "rt" "rp" "data" "time" "code" "var" "samp"
+ "kbd" "sub" "sup" "u" "mark" "bdi" "bdo" "span" "br" "wbr" "ins" "del" "picture" "source" "img"
+ "iframe" "embed" "object" "param" "video" "audio" "track" "map" "area" "table" "caption"
+ "colgroup" "col" "tbody" "thead" "tfoot" "tr" "td" "th" "form" "label" "input" "button" "select"
+ "datalist" "optgroup" "option" "textarea" "output" "progress" "meter" "fieldset" "legend"
+ "details" "summary" "dialog" "script" "noscript" "template" "slot" "canvas"))
+
+((tag_name) @markup.strong
+ (#any-of? @markup.strong "b" "strong"))
+
+((tag_name) @markup.italic
+ (#any-of? @markup.italic "i" "em"))
+
+((tag_name) @markup.link
+ (#any-of? @markup.link "a"))
+
+; Headings
+((tag_name) @markup.heading
+ (#any-of? @markup.heading "header"))
+
+((tag_name) @markup.heading.1
+ (#any-of? @markup.heading.1 "h1"))
+
+((tag_name) @markup.heading.2
+ (#any-of? @markup.heading.2 "h2"))
+
+((tag_name) @markup.heading.3
+ (#any-of? @markup.heading.3 "h3"))
+
+((tag_name) @markup.heading.4
+ (#any-of? @markup.heading.4 "h4"))
+
+((tag_name) @markup.heading.5
+ (#any-of? @markup.heading.5 "h5"))
+
+((tag_name) @markup.heading.6
+ (#any-of? @markup.heading.6 "h6"))
+
+((tag_name) @markup.list
+ (#any-of? @markup.list "ul" "ol" "li" "dl" "dt" "dd"))
diff --git a/runtime/queries/slim/indents.scm b/runtime/queries/slim/indents.scm
new file mode 100644
index 000000000..a06a75867
--- /dev/null
+++ b/runtime/queries/slim/indents.scm
@@ -0,0 +1,4 @@
+(tag) @indent.begin
+
+((tag) @indent.zero
+ (#any-of? @indent.zero "doctype" "html"))
diff --git a/runtime/queries/slim/injections.scm b/runtime/queries/slim/injections.scm
new file mode 100644
index 000000000..3bee13931
--- /dev/null
+++ b/runtime/queries/slim/injections.scm
@@ -0,0 +1,39 @@
+((ruby_inline) @injection.content
+ (#set! injection.language "ruby"))
+
+((ruby_lang) @injection.content
+ (#set! injection.language "ruby")
+ (#set! injection.combined))
+
+((javascript_lang) @injection.content
+ (#set! injection.language "javascript")
+ (#set! injection.combined))
+
+((css_lang) @injection.content
+ (#set! injection.language "css")
+ (#set! injection.combined))
+
+((sass_lang) @injection.content
+ (#set! injection.language "sass")
+ (#set! injection.combined))
+
+((scss_lang) @injection.content
+ (#set! injection.language "scss")
+ (#set! injection.combined))
+
+((less_lang) @injection.content
+ (#set! injection.language "less")
+ (#set! injection.combined))
+
+((scss_lang) @injection.content
+ (#set! injection.language "scss")
+ (#set! injection.combined))
+
+((markdown_lang) @injection.content
+ (#set! injection.language "markdown"))
+
+((rdoc_lang) @injection.content
+ (#set! injection.language "rdoc"))
+
+((comment) @injection.content
+ (#set! injection.language "comment"))
diff --git a/runtime/queries/slim/locals.scm b/runtime/queries/slim/locals.scm
new file mode 100644
index 000000000..e9f0b0079
--- /dev/null
+++ b/runtime/queries/slim/locals.scm
@@ -0,0 +1,7 @@
+(child) @local.scope
+
+(tag_name) @local.definition.function
+
+(tag_class) @local.definition.parameter
+
+(tag_id) @local.definition.constant