feat(diff): add diff parser

This commit introduce diff parser.
This commit is contained in:
gbprod 2022-10-18 13:15:07 +02:00 committed by Stephan Seitz
parent b9bcbf8d73
commit 1e4b23c266
4 changed files with 20 additions and 0 deletions

View file

@ -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

View file

@ -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)

View file

@ -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,

View file

@ -0,0 +1,6 @@
[(addition) (new_file)] @text.diff.add
[(deletion) (old_file)] @text.diff.delete
(commit) @constant
(location) @attribute
(command) @function