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.

Where Next?

Popular in Questions Top

mgjohns61585
Could someone help me? I'm making my first elixir program, number guessing game. I can't figure out how to convert the user's guess from ...
New
9mm
I am constructing a JSON object (map) and I need to conditionally set a field. I’m trying to write proper elixir-way code… and I’m at a l...
New
skosch
To my knowledge, put_in, Map.update etc. all have the one limitation of not automatically creating intermediate keys when needed (for exa...
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
JulienCorb
I am trying to implement my new.html.eex file to create new posts on my website. new.html.eex: &lt;h1&gt;Create Post&lt;/h1&gt; &lt;...
New
electic
Hi, I am new to Elixir. I am trying to use the DateTime component to insert a date into MySQL however the there seems to be no way to fo...
New
johnnyicon
Hi all, I've just started learning Elixir and Phoenix Framework, so please pardon my n00bness at this stage. I'm trying to use Postg...
New
vonH
When I run the Plug and I recompile I wind up having to use Ctrl C to quit iex and start again. Witht the help of rlwrap I can use the cu...
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
PeterCarter
There are pre-rolled solutions for other frameworks that do work. However, Phoenix does not seem to have these. Have people had good expe...
New

Other popular topics Top

danschultzer
None of the current solutions worked well for me, so I went ahead and built a user management system from scratch. This project took far...
548 29305 241
New
stefanchrobot
What’s the safe way to decode a JSON string into a struct? I want to avoid calling String.to_atom. Jason.decode can give me a map with st...
New
JeremM34
Hello, how can I check the Phoenix version ? Thanks !
New
ovidiubadita
Hey all, I discovered Elixir and I love it. I always wanted to learn a functional programming and I intended to go for Haskell, but afte...
New
grych
Hi folks, Few months ago I have announced the proof-of-concept of the library to manipulate the browsers DOM objects directly from Elixi...
639 52238 488
New
Lily
In templates/appointment/index.html.eex: &lt;%= for appointment &lt;- @appointments do %&gt; &lt;tr&gt; &lt;td&gt;&lt;%= appoi...
New
fayddelight
I tried installing elixir 1.11.2 erlang 23.3.4 via asdf in my zsh shell. Enabled the versions locally and globally. When I list them ...
New
AngeloChecked
What learn first? Rust or Elixir Hi Elixir community! I’m here because i want learn a new language. I’m a junior developer and mainly i ...
New
klo
Got a question about when to concat vs. prepending items to list then reversing to achieve appending. So i know lists boil down to [1 | ...
New
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 record...
New

We're in Beta

About us Mission Statement