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
This commit is contained in:
danymat
2023-06-07 21:56:05 +02:00
parent a9f560b490
commit 2f154166b4
2 changed files with 2 additions and 2 deletions

View File

@@ -74,7 +74,7 @@ return {
node_type = "default_parameter", node_type = "default_parameter",
subtree = { subtree = {
{ {
retrieve = "all", position = 1,
node_type = "identifier", node_type = "identifier",
extract = true, extract = true,
as = i.Parameter, as = i.Parameter,

View File

@@ -299,7 +299,7 @@ end
--- with multiple annotation conventions. --- with multiple annotation conventions.
---@tag neogen-changelog ---@tag neogen-changelog
---@toc_entry Changes in neogen plugin ---@toc_entry Changes in neogen plugin
neogen.version = "2.15.0" neogen.version = "2.15.1"
--minidoc_afterlines_end --minidoc_afterlines_end
return neogen return neogen