Instagram / LibCST

A concrete syntax tree parser and serializer library for Python that preserves many aspects of Python's abstract syntax tree
https://libcst.readthedocs.io/
Other
1.52k stars 186 forks source link

QualifiedNameProvider does not provide qualified name for keyword arguments. #520

Open thisfred opened 3 years ago

thisfred commented 3 years ago

for a function like:

def fun(arg):
    pass

the fully qualified name for arg will be fun.<locals>.arg, but for any call to the function that chooses to call it using a keyword argument:

fun(arg=1)

no metadata is found for arg. It seems like the necessary scope information would be there, but I suspect the visitor used by the QN provider does not traverse far enough into the arg node to hit arg.keyword, maybe?

thisfred commented 3 years ago

I will try to see if I can come up with a patch, but I wanted to gauge first whether this is a bug/omission, or intended behavior.

zsol commented 3 years ago

Yeah this looks like a bug

On Sun, 5 Sep 2021, 01:33 eric casteleijn, @.***> wrote:

I will try to see if I can come up with a patch, but I wanted to gauge first whether this is a bug/omission, or intended behavior.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/Instagram/LibCST/issues/520#issuecomment-913054670, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAAQJNGT6VJPTPLM6ZHTCF3UAKUDXANCNFSM5DNYE5RQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.