You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
At the moment, neogen's Python configuration doesn't seem to handle these nicely. I'm not completely sure, but my impression is that they don't get handled as expected because the typed parameter wrangling expects the sub-tree to have identifier and type, whereas there is an extra layer in the tree when the arbitrary args or kwargs either typed (either list_splat_pattern or dictionary_splat_pattern). At the moment, if I generate annotations for the example function given above, the identifier comes out empty i.e. the intended annotation isn't generated.
The tricky thing here is that I'm not sure if this is a neogen bug or a tree-sitter bug. Tree-sitter seems to parse the syntax correctly, but maybe it is missing something. The reason this seems possible is that there is e.g. "default_parameter" and "typed_default_paramter" but there is no equivalent pair for "list_splat_pattern" (i.e. there is no "typed_splat_pattern"). If you think this is actually a tree-sitter bug, which neogen could then handle, I'm happy to open an issue there instead.
Other questions:
What is the best way to report this? I see there isn't a test folder so I can't easily make a failing test. Are screenshots/gifs preferred? Or some other format?
(As a side note, I don't think PEP 692 causes any issues for the above, but maybe someone else sees something I don't)
The text was updated successfully, but these errors were encountered:
For cross-reference, it seems like the tree sitter folks are happy with the parsing (nvim-treesitter/nvim-treesitter#5874) so I think it probably needs a change in the type handling logic in neogen
Since PEP 484, it has been possible to have type hints on args and kwargs in a Python function e.g.
At the moment, neogen's Python configuration doesn't seem to handle these nicely. I'm not completely sure, but my impression is that they don't get handled as expected because the typed parameter wrangling expects the sub-tree to have identifier and type, whereas there is an extra layer in the tree when the arbitrary args or kwargs either typed (either list_splat_pattern or dictionary_splat_pattern). At the moment, if I generate annotations for the example function given above, the identifier comes out empty i.e. the intended annotation isn't generated.
The tricky thing here is that I'm not sure if this is a neogen bug or a tree-sitter bug. Tree-sitter seems to parse the syntax correctly, but maybe it is missing something. The reason this seems possible is that there is e.g. "default_parameter" and "typed_default_paramter" but there is no equivalent pair for "list_splat_pattern" (i.e. there is no "typed_splat_pattern"). If you think this is actually a tree-sitter bug, which neogen could then handle, I'm happy to open an issue there instead.
Other questions:
(As a side note, I don't think PEP 692 causes any issues for the above, but maybe someone else sees something I don't)
The text was updated successfully, but these errors were encountered: