No need to clone it like that. The LS won’t link to precompiled asdf install, but you can tell asdf to build it for you.
Edit: Cached page as original no longer available: Fixing "Go to Definition" for Elixir's standard library | Random Developer's Blog (original: Fixing “Go To Definition” for Elixir’s standard library | Random Developer’s Blog )
It turns out
asdf-elixir
is using precompiled version when you executeasdf install elixir <version>
which does not contain source code. However, if you take any commit reference (SHA string) from Elixir repo and useasdf install elixir ref:<commit_reference>
,asdf
will actually build it from the source to which that reference points. Each Elixir release is tagged so finding a commit reference for a correct version is pretty straightforward. After that, just as with normalasdf
installation, you have to executeasdf global elixir ref:<commit_reference>
to set that version as global.After this is done, go to any project, delete
.elixir_ls
,deps
and_build
, run VSCode again and wait for the language server finish its job. Now, “Go to Definition” should work for everything (for the standard library it actually takes a couple of seconds; others should be instant).