From 81295eb0c5fc05ab3796a28c9f160c3ac4098106 Mon Sep 17 00:00:00 2001 From: Riley Bruins Date: Fri, 3 Apr 2026 01:43:28 -0700 Subject: [PATCH] feat(parsers): add jjdescription (#8625) --- SUPPORTED_LANGUAGES.md | 1 + lua/nvim-treesitter/parsers.lua | 8 ++++ runtime/queries/jjdescription/highlights.scm | 42 ++++++++++++++++++++ runtime/queries/jjdescription/injections.scm | 6 +++ 4 files changed, 57 insertions(+) create mode 100644 runtime/queries/jjdescription/highlights.scm create mode 100644 runtime/queries/jjdescription/injections.scm diff --git a/SUPPORTED_LANGUAGES.md b/SUPPORTED_LANGUAGES.md index 978a4b8e..98b798ab 100644 --- a/SUPPORTED_LANGUAGES.md +++ b/SUPPORTED_LANGUAGES.md @@ -146,6 +146,7 @@ html_tags (queries only)[^html_tags] | unstable | `H IJ ` | @TravonteD [javascript](https://github.com/tree-sitter/tree-sitter-javascript) | unstable | `HFIJL` | @steelsojka [jinja](https://github.com/cathaysia/tree-sitter-jinja)[^jinja] | unstable | `H  J ` | @cathaysia [jinja_inline](https://github.com/cathaysia/tree-sitter-jinja)[^jinja_inline] | unstable | `H  J ` | @cathaysia +[jjdescription](https://github.com/ribru17/tree-sitter-jjdescription) | stable | `H  J ` | @ribru17 [jq](https://github.com/flurie/tree-sitter-jq) | unstable | `H  JL` | @ObserverOfTime [jsdoc](https://github.com/tree-sitter/tree-sitter-jsdoc) | unstable | `H    ` | @steelsojka [json](https://github.com/tree-sitter/tree-sitter-json) | unstable | `HFIJL` | @steelsojka diff --git a/lua/nvim-treesitter/parsers.lua b/lua/nvim-treesitter/parsers.lua index 17ec140e..fc5e42ac 100644 --- a/lua/nvim-treesitter/parsers.lua +++ b/lua/nvim-treesitter/parsers.lua @@ -1101,6 +1101,14 @@ return { readme_note = 'needed for full highlighting', tier = 2, }, + jjdescription = { + install_info = { + revision = 'v1.0.3', + url = 'https://github.com/ribru17/tree-sitter-jjdescription', + }, + maintainers = { '@ribru17' }, + tier = 1, + }, jq = { install_info = { revision = 'c204e36d2c3c6fce1f57950b12cabcc24e5cc4d9', diff --git a/runtime/queries/jjdescription/highlights.scm b/runtime/queries/jjdescription/highlights.scm new file mode 100644 index 00000000..7c87c08b --- /dev/null +++ b/runtime/queries/jjdescription/highlights.scm @@ -0,0 +1,42 @@ +[ + (comment) + (generated_comment) +] @comment + +(comment_content) @spell + +(subject) @markup.heading + +(type) @keyword + +(scope) @variable.parameter + +(change_id) @constant + +(filepath) @string.special.path + +((rest) @comment + (#not-lua-match? @comment "^diff")) + +"JJ: ignore-rest" @keyword.directive + +[ + "(" + ")" +] @punctuation.bracket + +":" @punctuation.delimiter + +"!" @punctuation.special + +[ + "A" + "C" +] @diff.plus + +"D" @diff.minus + +[ + "M" + "R" +] @diff.delta diff --git a/runtime/queries/jjdescription/injections.scm b/runtime/queries/jjdescription/injections.scm new file mode 100644 index 00000000..538383a3 --- /dev/null +++ b/runtime/queries/jjdescription/injections.scm @@ -0,0 +1,6 @@ +((comment_content) @injection.content + (#set! injection.language "comment")) + +((rest) @injection.content + (#lua-match? @injection.content "^diff") + (#set! injection.language "diff"))