diff options
| -rw-r--r-- | CONTRIBUTING.md | 3 | ||||
| -rw-r--r-- | README.md | 1 | ||||
| -rw-r--r-- | lua/nvim-treesitter/parsers.lua | 10 | ||||
| -rw-r--r-- | queries/diff/highlights.scm | 6 |
4 files changed, 20 insertions, 0 deletions
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 074722613..ea3cbc408 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -203,6 +203,9 @@ Mainly for markup languages. @text.note ; info notes @text.warning ; warning notes @text.danger ; danger/error notes + +@text.diff.add ; added text (for diff files) +@text.diff.delete ; deleted text (for diff files) ``` #### Tags @@ -191,6 +191,7 @@ We are looking for maintainers to add more parsers and to write query files for - [x] [d](https://github.com/CyberShadow/tree-sitter-d) (experimental, maintained by @nawordar) - [x] [dart](https://github.com/UserNobody14/tree-sitter-dart) (maintained by @Akin909) - [x] [devicetree](https://github.com/joelspadin/tree-sitter-devicetree) (maintained by @jedrzejboczar) +- [x] [diff](https://github.com/the-mikedavis/tree-sitter-diff) (maintained by @gbprod) - [x] [dockerfile](https://github.com/camdencheek/tree-sitter-dockerfile) (maintained by @camdencheek) - [x] [dot](https://github.com/rydesun/tree-sitter-dot) (maintained by @rydesun) - [x] [eex](https://github.com/connorlay/tree-sitter-eex) (maintained by @connorlay) diff --git a/lua/nvim-treesitter/parsers.lua b/lua/nvim-treesitter/parsers.lua index 0f2bdffce..85485aa55 100644 --- a/lua/nvim-treesitter/parsers.lua +++ b/lua/nvim-treesitter/parsers.lua @@ -1238,6 +1238,16 @@ list.twig = { filetype = "twig", } +list.diff = { + install_info = { + url = "https://github.com/the-mikedavis/tree-sitter-diff", + branch = "main", + files = { "src/parser.c" }, + }, + maintainers = { "@gbprod" }, + filetype = "gitdiff", +} + local M = { list = list, filetype_to_parsername = filetype_to_parsername, diff --git a/queries/diff/highlights.scm b/queries/diff/highlights.scm new file mode 100644 index 000000000..4b9cbad60 --- /dev/null +++ b/queries/diff/highlights.scm @@ -0,0 +1,6 @@ +[(addition) (new_file)] @text.diff.add +[(deletion) (old_file)] @text.diff.delete + +(commit) @constant +(location) @attribute +(command) @function |
