How to enable Go To Definition for dependency modules?

I use ElixirLS extension in vscode on Ubuntu 18.04. For now, Go To Definition by ElixirLS works well on non-dependency modules. I was wondering if there is any way to enable Go To Definition for dependency modules. For example this code,

defmodule Bud.Repo.Migrations.CreateUsers do
  use Ecto.Migration # <- Go To Definition here

  def change do
    create table(:users) do
      add :name, :string

I’m hoping by pressing F12(Go To Definition) on Ecto.Migration will be redirected to file deps/ecto_sql/lib/ecto/migration.ex. Is there any way to enable this kind of feature?

I think it will be quite helpful to take a look at source code directly like I used to do on PHP project with composer instead of relying on documentation only.

It works for for me most of the time. Check the output window to see if ElixirLS is running into errors that are stopping it from analysing the project.

Ah, it works now. I deleted the .elixir_ls directory and restarted the vscode. Thanks anyway.

1 Like