-
Notifications
You must be signed in to change notification settings - Fork 11
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
[WIP] Improve elixir-ls compilation #32
Conversation
Tested it by pointing coc-elixir to my fork e.g. |
not ideal I guess, maybe we will only call |
You're right,
|
ahh right 👍 |
if the user have asdf-elixir and asdf-erlang installed, can we call |
I'm not sure about this, I think i've to ask @axelson to help |
looks like |
still, it would be nice if we can figure out a way to improve current compilation to avoid the need to build/compile elixir-ls manually, as specified in https://github.com/elixir-lsp/coc-elixir#server-fails-to-start will let you know if I come up with something :D |
Would it be possible to add some code that checks if the server needs to be recompiled? And it could do that by checking if the current version of elixir and erlang is different the version used to compile ElixirLS? And if it is then coc-elixir could remove the existing release and recompile (or perhaps it could compile each elixir-erlang) pair into a new directory. As a side-note it is generally better for elixir-ls to run on the same version of elixir (and to a lesser degree erlang) that it was compiled with (here's one specific annoying issue elixir-lsp/elixir-ls#193). So I'm likely to move ElixirLS in the direction of compiling before launching than the reverse, although ideally that would be something that is built into ElixirLS rather than having to run that for each extension. |
As I understand, the plugin will compile ElixirLS once during installation using elixir/erlang versions installed on the user's machine. |
Does coc-elixir share one global installation of elixir-ls or is it one per project? Because if it's shared if you are using different versions of Elixir and Erlang you will run into problems. |
I think coc-elixir uses one global installation of elixir-ls. |
VSCode is released with a precompiled version of ElixirLS that was built with minimal elixir and erlang versions: https://github.com/elixir-lsp/elixir-ls/blob/f61e81f1ca7f564741a386dc353510d92469a838/.release-tool-versions |
Interesting! |
sorry just had the time It seems coc-elixir is already released with a precompiled version of ElixirLS. Apologies, I think some of my statements before is wrong and only applicable if you install elixir-ls via |
Maybe we can have a |
An attempt to improve elixir-ls compilation.
I notice elixir-ls uses asdf together with asdf-erlang and asdf-elixir. (checkout https://github.com/elixir-lsp/elixir-ls/blob/master/.tool-versions).
Maybe we can also use it by default for compilation.
I think this will reduce the need to compile elixir-ls manually (https://github.com/elixir-lsp/coc-elixir#server-fails-to-start)
Although this will require users to have asdf, asdf-erlang and asdf-elixir installed in their machine.
Not sure if this is ideal but seemed to work well on my testing.