Is there a way to know in advance which files Elixir Compilers will compile before calling `mix deps.compile` and `mix compile`?

These past few months, I have been working on Elixir LSP-related tasks. After opening the editor and starting the LSP, it needs to do some things before it can truly start working, such as fetching deps and compiling. Using WorkDoneProgress to report progress is a good way.

I mainly use a tracer to achieve this, which looks good but is not Awesome. My question is whether there is a way to know which files the Elixir compiler will compile so that I can calculate the total number in advance and have a precise percentage. This would make the UI better and the progress more straightforward.

In addition, I have looked at the logic of mix.tasks.compile and mix.tasks.compile_all, but I don’t quite understand their dependency calculation logic.