From cbac4273836f5837cec641ab21f365c79b102a4b Mon Sep 17 00:00:00 2001 From: Rotem Horesh <148942120+rotmh@users.noreply.github.com> Date: Mon, 5 May 2025 17:08:33 +0300 Subject: [PATCH] feat: add a tree-sitter grammar and highlights for dunst's config (#13458) --- book/src/generated/lang-support.md | 1 + languages.toml | 10 ++++++++++ runtime/queries/dunstrc/highlights.scm | 14 ++++++++++++++ 3 files changed, 25 insertions(+) create mode 100644 runtime/queries/dunstrc/highlights.scm diff --git a/book/src/generated/lang-support.md b/book/src/generated/lang-support.md index 8502f5db1..5b2962a48 100644 --- a/book/src/generated/lang-support.md +++ b/book/src/generated/lang-support.md @@ -46,6 +46,7 @@ | dot | ✓ | | | `dot-language-server` | | dtd | ✓ | | | | | dune | ✓ | | | | +| dunstrc | ✓ | | | | | earthfile | ✓ | ✓ | ✓ | `earthlyls` | | edoc | ✓ | | | | | eex | ✓ | | | | diff --git a/languages.toml b/languages.toml index f4ddccef3..13f70db4a 100644 --- a/languages.toml +++ b/languages.toml @@ -4339,3 +4339,13 @@ indent = { tab-width = 2, unit = " " } [[grammar]] name = "pug" source = { git = "https://github.com/zealot128/tree-sitter-pug", rev = "13e9195370172c86a8b88184cc358b23b677cc46" } + +[[language]] +name = "dunstrc" +scope = "source.dunstrc" +comment-tokens = ["#", ";"] +file-types = [ { glob = "dunst/dunstrc" } ] + +[[grammar]] +name = "dunstrc" +source = { git = "https://github.com/rotmh/tree-sitter-dunstrc", rev = "9cb9d5cc51cf5e2a47bb2a0e2f2e519ff11c1431" } diff --git a/runtime/queries/dunstrc/highlights.scm b/runtime/queries/dunstrc/highlights.scm new file mode 100644 index 000000000..8964b43de --- /dev/null +++ b/runtime/queries/dunstrc/highlights.scm @@ -0,0 +1,14 @@ +(assign + (key) @attribute) + +(comment) @comment.line + +[ + "[" + "]" +] @punctuation.bracket + +"=" @operator + +(section + (name) @namespace)