jjcarstens

jjcarstens

Nerves Core Team

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 :wink:). 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! :tada:

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 :tropical_drink:, maybe dance a little :dancer: :man_dancing:, and watch the red lines disappear from your project! (well, at least the ones caused by MIX_TARGET :wink:)

Check out the ElixirLS Changelog v0.5.0 section for details of other features in this update.

First Post!

lawik

lawik

Nerves Core Team

Thanks, feels like a personal favor :slight_smile:

Where Next?

Popular in Discussions Top

Crowdhailer
I’ve been hearing much about the new formatter and it’s something I have been keen to try. I find examples buy far the most illuminating...
248 19740 150
New
dogweather
I wrote this comment on r/haskell, and it’s not popular there. :wink: But I think I’m on to something… Haskell reminds me of Java, and e...
New
Rustixir
Hi everyone, im working on find best language/framework/system for high concurrency, high performance and stable performance after wor...
New
AstonJ
Can you believe the first professionally published Elixir book was published just 8 years ago? Since then I think we’ve seen more books f...
New
sergio
Kind of like when jquery came out, it was super necessary. Existing drag and drop libraries have a bunch of baggage to support old browse...
New
arcanemachine
https://nitter.net/josevalim/status/1744395345872683471 https://twitter.com/josevalim/status/1744395345872683471
New
shishini
I think this twitter post and youtube video didn’t get as much attention as I hoped I am still new to Elixir, so can’t really judge ...
New

Other popular topics Top

JeremM34
Hello, how can I check the Phoenix version ? Thanks !
New
joaquinalcerro
Hi there, I am working with Ecto-Postgresql and I need to call all of the records from a specific table but the table has 40,000 records...
New
greenz1
I have a phoenix application from which a user can download multiple(5-6) files of size 1MB. I couldn’t find anything related to sending ...
New
gshaw
What is the idiomatic way of matching for not nil in Elixir? E.g., First way: defp halt_if_not_signed_in(conn, signed_in_account) when...
New
alice
Hey, Just curious what are the main benefits of Elixir compared to Clojure? When is Elixir more useful than Clojure and vice versa? Th...
New
WestKeys
Currently suffering from paralysis by [HTTP client] analysis. This is rather unusual in Elixirland as there tends to be consensus on the ...
New

We're in Beta

About us Mission Statement