Ma233

Ma233

Failed to jump to definition of some Elixir built in modules by elixir-ls

Hi, I’m a new programmer of Elixir. I got a problem when using coc-elixir and elixir-ls.

While I can go to definition of all libs installed by mix, I can’t do that for modules implemented by Elixir. For example, I can go to modules of Ecto, Finch, Redix, but I can’t go to GenServer, Supervisor, Application, Keyword, Enum and Map.

Here is :gen_server.module_info. It’s strange that the source is ‘/buildroot/otp/lib/stdlib/src/gen_server.erl’, which I never have this path on my own computer.

I tried installing Elixir by homebrew or asdf. I also compiled an Elixir from the source code. The source has not changed.

iex(1)> :gen_server.module_info
[
  module: :gen_server,
  exports: [
    start: 3,
    start: 4,
    start_monitor: 3,
    start_monitor: 4,
    stop: 1,
    stop: 3,
    call: 2,
    send_request: 2,
    wait_response: 2,
    receive_response: 2,
    check_response: 2,
    abcast: 2,
    abcast: 3,
    multi_call: 2,
    multi_call: 3,
    multi_call: 4,
    enter_loop: 3,
    enter_loop: 4,
    enter_loop: 5,
    init_it: 6,
    wake_hib: 6,
    system_continue: 3,
    system_terminate: 4,
    system_code_change: 4,
    system_get_state: 1,
    system_replace_state: 2,
    format_status: 2,
    behaviour_info: 1,
    module_info: 0,
    module_info: 1,
    reply: 2,
    cast: 2,
    start_link: 4,
    start_link: 3,
    call: 3,
    format_log: 2,
    format_log: 1
  ],
  attributes: [vsn: [235044865929631859612519860561431147861]],
  compile: [
    version: '8.0.2',
    options: [
      :debug_info,
      {:d, :USE_ESOCK, true},
      {:i, '/buildroot/otp/lib/stdlib/src/../include'},
      {:i, '/buildroot/otp/lib/stdlib/src/../../kernel/include'}
    ],
    source: '/buildroot/otp/lib/stdlib/src/gen_server.erl'
  ],
  md5: <<176, 211, 254, 155, 70, 221, 37, 113, 151, 64, 207, 131, 77, 198, 181,
    85>>
]

Marked As Solved

mhanberg

mhanberg

Expert LSP Core Team

I believe this only works if you have compiled elixir yourself. Or else, there is literally no source code for it to jump to.

Also Liked

Ma233

Ma233

For some beginners who might run into the same problem as me. Don’t forget to run mix clean and rerun mix compile after you installed a new self-compiled Elixir.

Last Post!

Ma233

Ma233

For some beginners who might run into the same problem as me. Don’t forget to run mix clean and rerun mix compile after you installed a new self-compiled Elixir.

Where Next?

Popular in Questions Top

RisingFromAshes
I’ve read in another post that it may be possible with a router helper - but I couldn’t find an appropriate one, and tbh, I’m still just ...
New
vertexbuffer
Hello, can anybody help here..? I have a list of players and I what to delete an element, but every for loop the list is reverting to ori...
New
vonH
In asking this question I am more interested about the expressiveness of the language itself and less concerned about the availability of...
New
jononomo
For some reason my phoenix channels are working for me in my local dev environment, but as soon as I deploy via Docker, I get a 403 error...
New
sergio_101
I am VERY much an elixir newbie. I have taken one elixir course and one phoenix course on Udemy. During that course, I saw the instructor...
New
stefanluptak
Hello everybody, usually, I use a 29" ultra-wide monitor for VSCode which can easily accomodate explorer (files panel) + file with code ...
New
marius95
Hello everyone, I try to use an Javascript Event Handler in my root.html.leex file. Therefore I created a function in the app.js file: ...
New

Other popular topics Top

joaquinalcerro
Hi there, I am working with Ecto-Postgresql and I need to call all of the records from a specific table but the table has 40,000 records...
New
dogweather
I wrote this comment on r/haskell, and it’s not popular there. :wink: But I think I’m on to something… Haskell reminds me of Java, and e...
New
greenz1
I have a phoenix application from which a user can download multiple(5-6) files of size 1MB. I couldn’t find anything related to sending ...
New
axelson
This post is a wiki (feel free to hit the edit button near the bottom right of this post to add your own changes!) This post collects co...
239 49084 226
New
gausby
I asked this very same question on twitter and got some interesting feedback, but I thought it would be a good question to ask here as we...
1207 40042 209
New
AstonJ
Posting this to see if we can make things easier for people to get into Neovim. If you use Neovim and have a favourite distro please let ...
New

We're in Beta

About us Mission Statement