jjcarstens
MIX_TARGET in ElixirLS/VSCode >= 0.5.0
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.
First Post!
lawik
Popular in Discussions
Other popular topics
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #deployment
- #library
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #channels
- #elixirconf
- #exunit
- #discussion
- #code-sync
- #javascript
- #podcasts
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixir-ls
- #phoenix_html
- #iex
- #blog-post
- #graphql
- #genstage
- #ai
- #websockets
- #supervisor
- #elixirconf-us
- #advent-of-code
- #distillery
- #processes
- #forms
- #api
- #metaprogramming
- #security
- #hex












