-
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
Handle blank mix target value properly #670
Handle blank mix target value properly #670
Conversation
623bc50
to
33a8485
Compare
33a8485
to
9033754
Compare
I think that I'm misunderstanding this PR. I would not expect |
@fhunleth I tried to address it in Elixir, but Jose does not want it there. elixir-lang/elixir#11603 In the code in question, Elixir LS wants to force-update the Mix.target value using Maybe there is a way to convince Jose? |
I agree with Jose. Why can't the existing Elixir code that sets the default be used? |
Can't we opt out of setting target when it's |
This seems partly due to a change in VScode or some other underlying way of getting settings as I think you can adjust this line to include |
I also think changing this |
@lukaszsamson @jjcarstens I simplified the changes base on your feedback. What do you guys think?
|
I like this code. This looks like it's a problem with the current code too, but if you have a target set and then you unset it, don't you need to call |
I was told offline that the issue I was worried about is not a problem since Elixir LS restarts Mix when the setting changes. Thank you all at Elixir LS for the super useful tool and thanks @mnishiguchi for fixing the |
👍 LGTM! |
This addresses an empty string can get passed into
Mix.target/1
, which sets the Mix target value to:""
. Mix target is supposed to default to:host
butMix.target/1
force-updates it with any wrong value. We should make sure the target value is valid before converting it to atom.The accidental
:""
is bad, because for example, Nerves projects assumeMix.target/0
defaults to:host
.Notes
Mix.target()
is:""
for ElixirLS nerves-project/nerves#694Mix.target/1
in Elixir language first, but Jose says it is not Elixir's responsibility. Handle blank Mix target values properly elixir-lang/elixir#11603