Find usage of private modules and functions

Is it possible to find a list of external private modules/functions used in a project, potentially with mix xref?

My use-case is I’m trying to update a project that makes heavy use of Elixir internals (elixir-ls) and finding and isolating (and eventually eliminating) the private api usage would be very helpful!

Depends on how you will define private. If by private you mean modules and functions with hidden docs then you can see mix_unused to see how to list all called functions and then just iterate through them and use Code.fetch_docs/1 to check if the given module/function is hidden or not.

Yeah, I mean calling functions from modules with @moduledoc false. So things like easily finding if the code in my project is calling into Mix.ProjectStack. I’ll take a look at how you find all called functions in mix_unused.