The determination of the name of a function is currently done by
looking at the function node and its grandparent node (for the class),
and nothing else. This misses the class name for decorated methods as
well as producing nonsensible results for nested classes and functions
(though none of the frontends handle those right yet either).
Fix this by doing a full traversal up the tree and including all
functions and classes.
The broken decorator behavior was also sort of accidentally causing
the class name to be left off for staticmethods and classmethods
(which the collector does also), so we need to keep supporting that
behavior.
The determination of the name of a function is currently done by looking at the function node and its grandparent node (for the class), and nothing else. This misses the class name for decorated methods as well as producing nonsensible results for nested classes and functions (though none of the frontends handle those right yet either).
Fix this by doing a full traversal up the tree and including all functions and classes.
The broken decorator behavior was also sort of accidentally causing the class name to be left off for staticmethods and classmethods (which the collector does also), so we need to keep supporting that behavior.