nvim-treesitter/queries/javadoc/highlights.scm
Robert Muir 652da0b40f
feat(javadoc): add parser and queries (#7749)
Previously java was configured to use doxygen parser for documentation
comments, but javadocs are not doxygen. Inline tags have a different
syntax, block tags are not recognized, and doxygen creates a lot of
errors during highlighting.

Add parser for javadoc comments, with queries for highlights and
injections.
2025-03-23 16:44:12 +01:00

86 lines
1 KiB
Scheme

[
(tag_name)
"include"
"exclude"
] @nospell @keyword
(identifier) @nospell @variable
(fragment) @nospell @variable.member
(parameter
name: (identifier) @variable.parameter)
(param_tag
parameter_name: (identifier) @variable.parameter)
[
(boolean_type)
(integral_type)
(floating_point_type)
] @nospell @type.builtin
(module
(identifier) @module)
(type
(identifier) @type)
(type_parameter
(identifier) @type)
(method
(identifier) @function)
(member
(identifier) @variable.member)
[
(string_literal)
(indexword)
] @nospell @string
[
(bare_format_string)
(literal_format_string)
] @nospell @string.special
(url) @nospell @markup.link.url
(attribute
name: (identifier) @nospell @property)
(system_property) @nospell @property
(unsigned_integer) @number
(code) @nospell @markup.raw
[
"="
":"
] @operator
[
"/"
"."
","
"..."
"#"
"##"
] @punctuation.delimiter
[
"{"
"}"
"("
")"
"["
"]"
] @punctuation.bracket
(param_tag
[
"<"
">"
] @punctuation.bracket)