-
-
Notifications
You must be signed in to change notification settings - Fork 193
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
Mix.target()
is :""
for ElixirLS
#694
Comments
Ugh. I removed the workaround since I thought that the fix had been included for a sufficiently long time. I agree that the code looks good. Could it be that there's white space in the |
In case iex> ["", " ", "\n", " \t\t "] |> Enum.map(&String.to_atom/1)
[:"", :" ", :"\n", :" \t\t "] Looking at the elixir-lsp/elixir-ls codebase, Mix target shows in only a few locations.
Ah I think probably this is the root cause:
What can be done
I can make a PR for both. |
Yes, I agree that you found an issue (hopefully the issue). I also agree with your proposal. Thank you for figuring this out! |
OK, Elixir does not take responsibility of checking valid Mix target value. It is the user responsibility. That is fair. |
I misunderstood your proposal. Sorry about that. I really thought that it was to only change Elixir LS. I see that I read to quickly now. |
NP! I was not sure what would be best. I am glad we are gradually getting there. |
Close because now we know it is not directly related to Nerves. |
Maybe ElixirLS specific issue??? elixir-lsp/vscode-elixir-ls#132
mix.exs
full of red underlines with the error message:config/target.exs
(in my case).mix.exs
, everything is working fine.Environment
elixir -v
):mix nerves.env --info
)Additional information about your host, target hardware or environment that
may help
Current behavior
In
mix.exs
file, all lines are red-underlined, with the error message:Expected behavior
There should not be such an error...
Investigation
Looking at the output from ElixirLS, the error is caused by wrongly named configuration file:
config/.exs
!!!In the
nerves_livebook
project, only location that generate a configuration file name isconfig/target.exs
.https://github.com/mnishiguchi/nerves_livebook/blob/a7b51e4d840a7304019a637746ba93476f2b7028/config/target.exs#L94
I inspected the outputs of both
System.get_env("MIX_TARGET")
andMix.target()
inconfig/target.exs
.Here are results when running
mix deps.get
. This looks GOOD.Here is the output from ElixirLS. This looks BAD.
Mix.target()
is:""
???!!!Potential causes
Mix.target/0
's bug?At least,
Mix.target/0
and related code looks GOOD to me.I do not know what is capable of setting Mix target to
:""
...Quick fix
At least, I confirmed the following hack can avoid that error, but this does not address the root cause.
The text was updated successfully, but these errors were encountered: