Issue #198 Support java types: class and record fields, enum constants (#199)

This commit is contained in:
Michael Härtl
2024-11-12 19:47:37 +01:00
committed by GitHub
parent e932ba918b
commit e3b8f6dca1
3 changed files with 14 additions and 4 deletions

View File

@@ -233,7 +233,7 @@ There is a list of supported languages and fields, with their annotation style
| cs | [Xmldoc](https://docs.microsoft.com/fr-fr/dotnet/csharp/language-reference/xmldoc/) (`"xmldoc"`) <br> [Doxygen](https://www.doxygen.nl/manual/commands.html) (`"doxygen"`) | `func`, `file`, `class` |
| cpp | [Doxygen](https://www.doxygen.nl/manual/commands.html) (`"doxygen"`) | `func`, `file`, `class` |
| go | [GoDoc](https://go.dev/blog/godoc) (`"godoc"`) | `func`, `type` |
| java | [Javadoc](https://docs.oracle.com/javase/1.5.0/docs/tooldocs/windows/javadoc.html#documentationcomments) (`"javadoc`) | `func`, `class` |
| java | [Javadoc](https://docs.oracle.com/javase/1.5.0/docs/tooldocs/windows/javadoc.html#documentationcomments) (`"javadoc`) | `func`, `class`, `type` |
| javascript | [JSDoc](https://jsdoc.app) (`"jsdoc"`) | `func`, `class`, `type`, `file` |
| javascriptreact | [JSDoc](https://jsdoc.app) (`"jsdoc"`) | `func`, `class`, `type`, `file` |
| julia | [Julia](https://docs.julialang.org/en/v1/manual/documentation/#Writing-Documentation) (`"julia"`) | `func`, `class` |

View File

@@ -55,6 +55,7 @@ return {
parent = {
class = { "class_declaration", "interface_declaration", "record_declaration" },
func = { "method_declaration", "constructor_declaration" },
type = { "field_declaration", "enum_constant", "formal_parameter" },
},
data = {
@@ -139,6 +140,15 @@ return {
},
},
},
type = {
["field_declaration|enum_constant|formal_parameter"] = {
["0"] = {
extract = function()
return {}
end,
},
},
},
},
template = template:add_default_annotation("javadoc"),

View File

@@ -1,9 +1,9 @@
local i = require("neogen.types.template").item
return {
{ nil, "/**", { no_results = true, type = { "class", "func" } } },
{ nil, " * $1", { no_results = true, type = { "class", "func" } } },
{ nil, " */", { no_results = true, type = { "class", "func" } } },
{ nil, "/**", { no_results = true, type = { "class", "func", "type" } } },
{ nil, " * $1", { no_results = true, type = { "class", "func", "type" } } },
{ nil, " */", { no_results = true, type = { "class", "func", "type" } } },
{ nil, "/**" },
{ nil, " * $1" },