fix(java): support record annotation in java (#182) (#192)

This commit is contained in:
Michael Härtl
2024-08-13 11:48:48 +02:00
committed by GitHub
parent 4b22542b96
commit dc50715c00
2 changed files with 16 additions and 2 deletions

View File

@@ -53,7 +53,7 @@ local function_tree = {
return {
parent = {
class = { "class_declaration", "interface_declaration" },
class = { "class_declaration", "interface_declaration", "record_declaration" },
func = { "method_declaration", "constructor_declaration" },
},
@@ -124,6 +124,20 @@ return {
end,
},
},
["record_declaration"] = {
["0"] = {
extract = function(node)
local results = {}
local tree = { { retrieve = "all", node_type = "identifier", extract = true } }
local nodes = nodes_utils:matching_nodes_from(node, tree)
local res = extractors:extract_from_matched(nodes)
return {
[i.ClassName] = res.identifier
}
end,
},
},
},
},

View File

@@ -309,7 +309,7 @@ end
--- with multiple annotation conventions.
---@tag neogen-changelog
---@toc_entry Changes in neogen plugin
neogen.version = "2.19.3"
neogen.version = "2.19.4"
--minidoc_afterlines_end
return neogen