Skip to content
This repository has been archived by the owner on Sep 1, 2023. It is now read-only.

Debugging 2.x.x

Milad edited this page Sep 4, 2017 · 1 revision

document is work in progress

Debug alchemist client

Requirements

  • Elixir 1.3 or above
  • Erlang 19 or above
  • Python

PING

The first thing you can do is to make sure Alchemist.vim works, cd to your elixir root project and execute alchemist_client and then type PING and wait for the PONG response

cd ~/my/elixir/project
~/.vim/bundle/alchemist.vim/alchemist_client -d ./
PING
PONG
END-OF-PING

Do you have python, Elixir and Erlang in your machine?

If you can't pass this steps open an issue!

Lookup Elixir's Library

Looks up for the file that a function is defined in with DEFL

~/.vim/bundle/alchemist.vim/alchemist_client -d ./
DEFL { "List,flatten", [ context: Elixir, imports: [], aliases: [] ] }
/private/tmp/elixir-20170105-33654-j6r5gw/elixir-1.4.0/lib/elixir/lib/list.ex
END-OF-DEFL

And lookup line of definition with DEFLX

~/.vim/bundle/alchemist.vim/alchemist_client -d ./
DEFLX { "List.flatten", [ context: Elixir, imports: [], aliases: [] ] }
/private/tmp/elixir-20170105-33654-j6r5gw/elixir-1.4.0/lib/elixir/lib/list.ex:1
END-OF-DEFL

Lookup Project's Library

Create lib/custom_module.ex with this content in your project

defmodule CustomModule do
  def foo do
    :ok
  end
end

Now let's see Alchemist.vim can find the file and definition

~/.vim/bundle/alchemist.vim/alchemist_client -d ./
DEFL { "CustomModule,foo", [ context: Elixir, imports: [], aliases: [] ] }
/private/tmp/my_app/lib/custom_module.ex
END-OF-DEFL

If the result is empty, run mix compile and retry again

And lookup line of definition with DEFLX

~/.vim/bundle/alchemist.vim/alchemist_client -d ./
DEFLX { "CustomModule.foo", [ context: Elixir, imports: [Quickfix], aliases: []] }
/private/tmp/my_app/lib/custom_module.ex:2
END-OF-DEFL