mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-05 21:10:15 -04:00
feat: add Doxygen
This commit is contained in:
parent
4d41d9bfb0
commit
a4f4fcdd3e
11 changed files with 74 additions and 3 deletions
|
|
@ -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