Is there a emacs plugin which lists all the methods in the module in a side pane.
I am looking for a plugin which has keyboard shortcuts to show/hide all the methods in python module file currently opened.
The dir() function The dir() built-in function returns a sorted list of strings containing the names defined by a module. The list contains the names of all the modules, variables, and functions that are defined in a module.
We've then used the dir () function to display the attributes provided by the module. Here is a brief description of the attributes: Bye, Welcome – the functions provided by the module. __builtins__ – a listing of all the built-in attributes that are accessible from the module.
We can list down all the functions present in a Python module by simply using the dir() method in the Python shell or in the command prompt shell.
You can use dir(module) to see all available methods/attributes.
For the first question, use M-xspeed-bar
, like Alex suggested.
For the second, enable hs-minor-mode
, M-xhs-minor-mode
, and use C-cC-@C-S-h to hide all methods, and C-cC-@C-S-s to show.
I suggest using elpy.
C-c C-o
runs elpy-occur-definitions which creates a new buffer with a list of all the class and function signatures.
You can navigate the list using C-n
and C-p
.
The mode works with next-error-follow minor mode.
So C-c C-f
inside the buffer enables jumping to the class or function definition selected.
Here's an example of the contents of that buffer:
8 matches for "^ *\(def\|class\) " in buffer: leveling_utils.py
11:def leveling(episodes_with_potential_associations_by_member):
26:def _apply_leveling(sorted_episodes):
41:def _set_non_chronic_associations(episode):
73:def _apply_sub_to_procedural_association(assoc):
94:def _set_chronic_associations(episode):
102:def _set_associations_for_self(episode):
118:def _set_to_actual(association):
122:def _log_actual_associations(member, leveled_episodes):
By the way, it has many other useful features that to me, make it a necessary addition to python-mode.
You can look to ECB (it's better to take my fork of it, as it's adapted to fresh Emacs & CEDET) - it can display information about source code fetching it from Semantic (CEDET subpackage) or via imenu
(for languages that aren't supported by Semantic).
Speedbar (included into GNU Emacs) can also show a list of top level objects, but doesn't show differences between imports, functions of other top-level stuff
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With