tonini / alchemist.el

Elixir Tooling Integration Into Emacs
http://www.alchemist-elixir.org
906 stars 103 forks source link

Can't jumping to the definition of a function which is defined in a module imported by the __using__ macro. #366

Open wolfgangshilei opened 5 years ago

wolfgangshilei commented 5 years ago

Suppose that there are three modules defined as below:

a.ex:

defmodule TestAlchemist.A do
  use TestAlchemist.B

  IO.inspect func_in_c()
  IO.inspect func_in_b()
end

b.ex:

defmodule  TestAlchemist.B do
  defmacro __using__(_) do
    quote do
      import TestAlchemist.B
      import TestAlchemist.C
    end
  end

  def func_in_b(), do: "func_in_b"
end

c.ex:

defmodule TestAlchemist.C do
  def func_in_c(), do: "func_in_c"
end

Then in module TestAlchmist.A, if I want to go to the definition of func_in_c with M-. , I will get the error:

Don’t know how to find: func_in_c

Alchemist version: 1.8.2 (package: 20180312.1304) GNU Emacs 25.3.1