Sort functions by usage #891
Replies: 1 comment
|
Currently there's no such capability (or anything remotely similar) in rope, but if anyone else is interested in this kind of automated class/function organisation tool, then please make some noise. Such a tool will likely have a not very well defined behavior though, especially with how they're supposed to handle things like comments between function after they've been automatically sorted. And in dynamic language like Python specifically, class/function are defined, not declared, so they have dependencies that matters at runtime, which is relevant for things like decorators, function argument's default values, etc. A virtual view of the files which doesn't physically reorganise the actual order of files like the call hierarchy view is likely much simpler as they don't need to modify the files. Rope does have some of the basic mechanism that collects the information to figure out call hierarchies, etc, as it uses those information for many refactoring operations, but it'll probably need to define a proper API to expose that information to LSPs. |
Uh oh!
There was an error while loading. Please reload this page.
Is rope already able to sort the functions of a class by their usage?
Also see
https://stackoverflow.com/questions/76611154/how-to-automatically-sort-functions-in-classes-by-their-usage
All reactions