mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-01 19:17:02 -04:00
feat: add Doxygen
This commit is contained in:
parent
4d41d9bfb0
commit
a4f4fcdd3e
11 changed files with 74 additions and 3 deletions
|
|
@ -209,6 +209,7 @@ We are looking for maintainers to add more parsers and to write query files for
|
|||
- [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] [doxygen](https://github.com/amaanq/tree-sitter-doxygen) (maintained by @amaanq)
|
||||
- [x] [dtd](https://github.com/ObserverOfTime/tree-sitter-xml) (maintained by @ObserverOfTime)
|
||||
- [x] [ebnf](https://github.com/RubixDev/ebnf) (experimental, maintained by @RubixDev)
|
||||
- [x] [eex](https://github.com/connorlay/tree-sitter-eex) (maintained by @connorlay)
|
||||
|
|
|
|||
|
|
@ -107,6 +107,9 @@
|
|||
"dot": {
|
||||
"revision": "9ab85550c896d8b294d9b9ca1e30698736f08cea"
|
||||
},
|
||||
"doxygen": {
|
||||
"revision": "19284113dbd42263c13b39d81b2a3b2492022c9b"
|
||||
},
|
||||
"dtd": {
|
||||
"revision": "9deacbfb79cb3527a0396255beb17e1bba3f2052"
|
||||
},
|
||||
|
|
|
|||
|
|
@ -376,6 +376,14 @@ list.dot = {
|
|||
maintainers = { "@rydesun" },
|
||||
}
|
||||
|
||||
list.doxygen = {
|
||||
install_info = {
|
||||
url = "https://github.com/amaanq/tree-sitter-doxygen",
|
||||
files = { "src/parser.c", "src/scanner.c" },
|
||||
},
|
||||
maintainers = { "@amaanq" },
|
||||
}
|
||||
|
||||
list.dtd = {
|
||||
install_info = {
|
||||
url = "https://github.com/ObserverOfTime/tree-sitter-xml",
|
||||
|
|
|
|||
|
|
@ -5,9 +5,13 @@
|
|||
(#set! injection.language "comment"))
|
||||
|
||||
((comment) @injection.content
|
||||
(#match? @injection.content "/\*!([a-zA-Z]+:)?re2c")
|
||||
(#match? @injection.content "/\\*!([a-zA-Z]+:)?re2c")
|
||||
(#set! injection.language "re2c"))
|
||||
|
||||
((comment) @injection.content
|
||||
(#lua-match? @injection.content "/[*][!<*][^a-zA-Z]")
|
||||
(#set! injection.language "doxygen"))
|
||||
|
||||
; TODO: add when asm is added
|
||||
; (gnu_asm_expression assembly_code: (string_literal) @injection.content
|
||||
; (#set! injection.language "asm"))
|
||||
|
|
|
|||
|
|
@ -4,6 +4,10 @@
|
|||
((comment) @injection.content
|
||||
(#set! injection.language "comment"))
|
||||
|
||||
((comment) @injection.content
|
||||
(#lua-match? @injection.content "/[*][!<*][^a-zA-Z]")
|
||||
(#set! injection.language "doxygen"))
|
||||
|
||||
(raw_string_literal
|
||||
delimiter: (raw_string_delimiter) @injection.language
|
||||
(raw_string_content) @injection.content)
|
||||
|
|
|
|||
38
queries/doxygen/highlights.scm
Normal file
38
queries/doxygen/highlights.scm
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
((tag_name) @keyword
|
||||
(#set! "priority" 105))
|
||||
|
||||
(identifier) @variable
|
||||
|
||||
((tag
|
||||
(tag_name) @_param
|
||||
(identifier) @parameter)
|
||||
(#any-of? @_param "@param" "\\param"))
|
||||
|
||||
(function (identifier) @function)
|
||||
|
||||
(function_link) @function
|
||||
|
||||
(emphasis) @text.emphasis
|
||||
|
||||
"\\a" @tag
|
||||
|
||||
[
|
||||
"in"
|
||||
"out"
|
||||
"inout"
|
||||
] @storageclass
|
||||
|
||||
"~" @operator
|
||||
|
||||
[
|
||||
"<a"
|
||||
">"
|
||||
"</a>"
|
||||
] @tag
|
||||
|
||||
[
|
||||
","
|
||||
"::"
|
||||
] @punctuation.delimiter
|
||||
|
||||
[ "(" ")" "[" "]" ] @punctuation.bracket
|
||||
1
queries/doxygen/indents.scm
Normal file
1
queries/doxygen/indents.scm
Normal file
|
|
@ -0,0 +1 @@
|
|||
(document) @indent.auto
|
||||
8
queries/doxygen/injections.scm
Normal file
8
queries/doxygen/injections.scm
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
((type) @injection.content
|
||||
(#set! injection.parent))
|
||||
|
||||
((function_link) @injection.content
|
||||
(#set! injection.parent))
|
||||
|
||||
((link) @injection.content
|
||||
(#set! injection.language "html"))
|
||||
|
|
@ -20,5 +20,5 @@
|
|||
(#set! injection.language "regex")))
|
||||
|
||||
((comment) @injection.content
|
||||
(#match? @injection.content "/\*!([a-zA-Z]+:)?re2c")
|
||||
(#match? @injection.content "/\\*!([a-zA-Z]+:)?re2c")
|
||||
(#set! injection.language "re2c"))
|
||||
|
|
|
|||
|
|
@ -3,3 +3,7 @@
|
|||
(line_comment)
|
||||
] @injection.content
|
||||
(#set! injection.language "comment"))
|
||||
|
||||
((block_comment) @injection.content
|
||||
(#lua-match? @injection.content "/[*][!<*][^a-zA-Z]")
|
||||
(#set! injection.language "doxygen"))
|
||||
|
|
|
|||
|
|
@ -39,5 +39,5 @@
|
|||
(#set! injection.language "regex"))
|
||||
|
||||
((block_comment) @injection.content
|
||||
(#match? @injection.content "/\*!([a-zA-Z]+:)?re2c")
|
||||
(#match? @injection.content "/\\*!([a-zA-Z]+:)?re2c")
|
||||
(#set! injection.language "re2c"))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue