From dc50715c009f89b8111197fd2f282f6042daa7ea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20H=C3=A4rtl?= Date: Tue, 13 Aug 2024 11:48:48 +0200 Subject: [PATCH] fix(java): support record annotation in java (#182) (#192) --- lua/neogen/configurations/java.lua | 16 +++++++++++++++- lua/neogen/init.lua | 2 +- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/lua/neogen/configurations/java.lua b/lua/neogen/configurations/java.lua index 34119c5..c5a9c35 100644 --- a/lua/neogen/configurations/java.lua +++ b/lua/neogen/configurations/java.lua @@ -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, + }, + }, }, }, diff --git a/lua/neogen/init.lua b/lua/neogen/init.lua index 70d3403..7427d85 100644 --- a/lua/neogen/init.lua +++ b/lua/neogen/init.lua @@ -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