by bern4444 · 4y ago · 0 comments
I want to know all the callers and callees of every function. This shouldn't be too hard, we already have find references via LSP.
Turning this into a graph would make it significantly easier to manage the entry and exit points of a code base and inform architecture decisions, refactors, type checking, hot paths etc.
The AST module was super handy as you'd expect. The script would optionally take some filters to reduce the size of the generated graph, and then it sent all the info to Graphiz (it emitted DOT, too, so it could be version controlled!!)
It was extremely fun, highly recommended.