Generating callgraph from elm code

Is there any way to generate the callgraph of a set of elm files? I imagine it could be extracted from the parse step done in elm-analyze or elm-format, but I’m not sure where to start…

I believe you will have the best luck with elm-review. It is kind of the successor of elm-analyse and is designed to support custom rules. Maybe Review.Rule - elm-review 2.3.11 helps to get you started.

Thanks! Looking at the links in elm-review I found elm-syntax and then elm-xref: I think I have enough to get started.

1 Like

Ah, yes, I forgot about elm-xref. Thanks for the reminder. :slight_smile:

1 Like

If you are looking for a graph of module imports, then elm-analyse already does that. If you run it with --serve, somewhere in the UI you will be able to find the call graph represented as a DOT file, for which you can find an online interpreter which will draw it for you. (sorry for being fuzzy about the details but I’m having difficulties running it right now :thinking: )

Thanks. Unfortunately, I’m not just looking for the call graph at the module level…

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.