The latest ElixirLS release (v0.5.0) includes a little known change that makes a huge impact to the Nerves community - MIX_TARGET
support!
What does this mean?
Well, have you ever scoped a dependency to a target for your Nerves project? (the answer is yes because systems do this by default ). Something like:
{:cowsay, "~> 0.0.1", targets: :rpi3}
Then in your favorite editor, you use a module from that dep and get some unsavory lines stating that the āmodule is not availableā Ā¬
Or, your mix.exs
explodes with red lines and cryptic errors in the dependencies Ā¬
Thats because the ElixirLS process in the background was unable to resolve the context of a MIX_TARGET
which meant any deps scoped to that target were totally missing because mix didnāt know to fetch them.
But no more!
Now you can set a mixTarget
setting for the server to use when its going through deps resolution. In VSCode, this is a simple ElixirLS setting (elixirLS.mixTarget
)
And thatās it - Now sit back, enjoy a mimosa , maybe dance a little , and watch the red lines disappear from your project! (well, at least the ones caused by MIX_TARGET )
Check out the ElixirLS Changelog v0.5.0 section for details of other features in this update.