Elixir LS not showing warnings

In case of the previous issue I discovered with Elixir <> Dialyzer integration, the root cause was the same - Elixir setting location to 0 for some forms. Erlang to pick the line number was trying to pick the lowest number in the AST, so when some of forms inside the tree had it set to 0, 0 was being picked.

It was fine to “fix” it on the Erlang side, because it didn’t require much hassle (my fix was just a 1 line change, but the Erlang/OTP team decided to merge an alternative PR with a small cleanup as well).

At this point, after discovering this second issue that has the same root cause, I believe Elixir should be a better BEAM citizen and generate Erlang AST that integrates more nicely with the tooling, by correctly adding code location where it can (it would just require passing down location in a few places in the compiler).

Someone should open an issue in the Elixir repo to see what the Elixir team thinks, (I am spending enough time on making Elixir work well with Dialyzer already :slight_smile: )

4 Likes