-
Notifications
You must be signed in to change notification settings - Fork 194
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support MIX_TARGET? #248
Comments
Hi @jjcarstens, supporting |
Okay, so a few thoughts and hopefully they make sense to you:
|
Okay that makes sense. So it sounds like once we have an in-repo configuration file (which is almost done and is tracked in #226) then that can be used to set the workspace setting (additionally someone could add a gui setting to the vscode extension). Then if the user wants to change the target they just need to change the setting in the file and restart ElixirLS. I can push up my branch with the configuration file if you want to base it off of there but it should be relatively easy to integrate after. For the implementation I'd imagine that we'd primarily be adding a new key to |
So But, elixir-ls minimum version is 1.7. I'm guessing the extension is built and published from that version, right? Does that mean all these language server dep fetching and building happens under an older elixir version as well? If so, this might be moot and we would miss out on actually getting the mix integration with This is my attempt so far but it doesn't seem to be working. |
And here's how I'm setting that state (just in vscode) |
@jjcarstens do you have a repo that could be used to easily test if the correct
ElixirLS is built with 1.7 but runs under the Elixir version that the user is running (which is a bit dicey), but that should allow supporting MIX_TARGET. |
Here's a simple contrived example to test: I'd expect this warning to go away in the main module. You can also test with a brand new Nerves project with Or, this is a pretty simple Nerves based fw project that you can clone and immediately get all the red: |
Okay, so I played with https://github.com/jjcarstens/target_test a bit and everything appears to work. My guess is that you weren't actually running ElixirLS with your changes (a good way to verify that is to change the startup message in But anyway I was looking at the Elixir docs in more detail and I noticed that it says:
Which I didn't previously realize (do you know if that is still accurate?). That coupled with the fact that I have a workaround to suggest means that I'm leaning towards not including support directly in ElixirLS. The workaround is to edit your
Documentation about the setup.sh file can be found at https://github.com/elixir-lsp/elixir-ls/tree/f7b0524f721fddfda39f48d26bea23b978e8d5e7#local-setup |
Totally possible I wasn't running things right. I did add some print statements for Is it experimental? -> Not sure. It has been in there for ~1.5 years and hasn't changed. Nerves is totally integrated with it now. So I feel like it was just forgotten about and no one removed that note? I put out a few feelers and this just happened: elixir-lang/elixir#10056 🤣 For the workaround, does it have to be So |
Okay, so now that
Only |
🙌 yas! Love it. Just to clarify, are you planning to implement this proposal or want me to? (I’m good either way, just not sure from that statement and don’t want to double up work 😉) |
I'd love it if you took this on (as discussed over slack) |
Oops, wrong button |
For elixir-lsp#248 This allows you to set MIX_TARGET in a config and have it used in Elixir versions >= 1.8 This is most often used with Nerves and removes a lot of compilation errors in repos relying on a target to be set
For #248 This allows you to set MIX_TARGET in a config and have it used in Elixir versions >= 1.8 This is most often used with Nerves and removes a lot of compilation errors in repos relying on a target to be set
This isn't so much an issue as a feature request.
For those of use who do a lot of Nerves development, using
elixir-ls
and the vscode extension results in many error and warning lines because some dependencies are dependent onMIX_TARGET != :host
and basically just requires having to turn off dialyzer and other fun features of this language server.What is the general thought about supporting
MIX_TARGET
as a setting to be used when fetching deps and building plt?I'd be happy to do the work, but might need a few hints (I have some local stuff where I can set the setting, but can't quite get it to work when fetching deps...)
The text was updated successfully, but these errors were encountered: