feat(java): add injections for markdown documentation comments

Since Java 23, java documentation supports markdown.
It is supported by a '///' line comment followed by mandatory
white space: https://openjdk.org/jeps/467
This commit is contained in:
Robert Muir 2025-02-08 23:50:26 -05:00 committed by Christian Clason
parent 36bbf51842
commit cb8e810a1e

View file

@ -8,6 +8,18 @@
(#lua-match? @injection.content "/[*][!<*][^a-zA-Z]")
(#set! injection.language "doxygen"))
; markdown-style javadocs: https://openjdk.org/jeps/467
((line_comment) @injection.content
(#lua-match? @injection.content "^///%s")
(#offset! @injection.content 0 4 0 0)
(#set! injection.language "markdown_inline"))
; markdown-style javadocs: https://openjdk.org/jeps/467
((line_comment) @injection.content
(#lua-match? @injection.content "^///%s+[@]")
(#offset! @injection.content 0 4 0 0)
(#set! injection.language "doxygen"))
((method_invocation
name: (identifier) @_method
arguments: (argument_list