Is there a Python library that analyzes a source code file so that I can list all classes and method names and possibly print them as a tree?
Furthermore, I need to pass a character argument to it which contains the index of a character in the code. Think of it like the caret position. The library should tell me the parent methods and classes (outer parent classes which got inherited by using import statements can be ignored; so that I can build a parent tree) and the methods next to my caret position (like siblings).
That library must also be able to handle all major programming languages (Python, C, C++, Java, Swift, ...)
Does anyone know of such a library or will I have to build one on my own?