mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-19 03:40:04 -04:00
feat(diff): add diff parser
This commit introduce diff parser.
This commit is contained in:
parent
b9bcbf8d73
commit
1e4b23c266
4 changed files with 20 additions and 0 deletions
|
|
@ -203,6 +203,9 @@ Mainly for markup languages.
|
||||||
@text.note ; info notes
|
@text.note ; info notes
|
||||||
@text.warning ; warning notes
|
@text.warning ; warning notes
|
||||||
@text.danger ; danger/error notes
|
@text.danger ; danger/error notes
|
||||||
|
|
||||||
|
@text.diff.add ; added text (for diff files)
|
||||||
|
@text.diff.delete ; deleted text (for diff files)
|
||||||
```
|
```
|
||||||
|
|
||||||
#### Tags
|
#### 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] [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] [dart](https://github.com/UserNobody14/tree-sitter-dart) (maintained by @Akin909)
|
||||||
- [x] [devicetree](https://github.com/joelspadin/tree-sitter-devicetree) (maintained by @jedrzejboczar)
|
- [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] [dockerfile](https://github.com/camdencheek/tree-sitter-dockerfile) (maintained by @camdencheek)
|
||||||
- [x] [dot](https://github.com/rydesun/tree-sitter-dot) (maintained by @rydesun)
|
- [x] [dot](https://github.com/rydesun/tree-sitter-dot) (maintained by @rydesun)
|
||||||
- [x] [eex](https://github.com/connorlay/tree-sitter-eex) (maintained by @connorlay)
|
- [x] [eex](https://github.com/connorlay/tree-sitter-eex) (maintained by @connorlay)
|
||||||
|
|
|
||||||
|
|
@ -1238,6 +1238,16 @@ list.twig = {
|
||||||
filetype = "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 = {
|
local M = {
|
||||||
list = list,
|
list = list,
|
||||||
filetype_to_parsername = filetype_to_parsername,
|
filetype_to_parsername = filetype_to_parsername,
|
||||||
|
|
|
||||||
6
queries/diff/highlights.scm
Normal file
6
queries/diff/highlights.scm
Normal file
|
|
@ -0,0 +1,6 @@
|
||||||
|
[(addition) (new_file)] @text.diff.add
|
||||||
|
[(deletion) (old_file)] @text.diff.delete
|
||||||
|
|
||||||
|
(commit) @constant
|
||||||
|
(location) @attribute
|
||||||
|
(command) @function
|
||||||
Loading…
Add table
Add a link
Reference in a new issue