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

@@ -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" },