From 2f154166b4ecd2d237c957c5bea9473bd2ffba1f Mon Sep 17 00:00:00 2001 From: danymat Date: Wed, 7 Jun 2023 21:56:05 +0200 Subject: [PATCH] fix(py): Only count first identifier in default_parameter (fix #148) Default parameters such as: ```python def test(foo=delimiter): pass ``` where counting `delimiter` as Parameters. To fix that, I only return the first child in a `default_parameter` tree --- lua/neogen/configurations/python.lua | 2 +- lua/neogen/init.lua | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lua/neogen/configurations/python.lua b/lua/neogen/configurations/python.lua index 0aff852..fb5c3f4 100644 --- a/lua/neogen/configurations/python.lua +++ b/lua/neogen/configurations/python.lua @@ -74,7 +74,7 @@ return { node_type = "default_parameter", subtree = { { - retrieve = "all", + position = 1, node_type = "identifier", extract = true, as = i.Parameter, diff --git a/lua/neogen/init.lua b/lua/neogen/init.lua index 9106cb9..9a6e09c 100644 --- a/lua/neogen/init.lua +++ b/lua/neogen/init.lua @@ -299,7 +299,7 @@ end --- with multiple annotation conventions. ---@tag neogen-changelog ---@toc_entry Changes in neogen plugin -neogen.version = "2.15.0" +neogen.version = "2.15.1" --minidoc_afterlines_end return neogen