 # any of the `GenServer.Behaviour` conveniences.
 defmodule Kernel.LexicalTracker do
   @moduledoc false
-  @timeout 30_000
+  @timeout 30000
   @behaviour :gen_server
 
   @doc """

    directives =
      state.directives
      |> Enum.reject(&match?({{:import, {^module, _, _}}, _}, &1))
      |> :maps.from_list
      |> add_directive(module, line, warn, :import)

    directives =


  defp partition([{remote, :compile} | t], compile, runtime),
    do: partition(t, [remote | compile], runtime)

  defp partition([{remote, :runtime} | t], compile, runtime),
    do: partition(t, compile, [remote | runtime])

  defp partition([], compile, runtime), do: {compile, runtime}

  # Callbacks helpers

  defp add_reference(references, module, :runtime) when is_atom(module),
    do: map_put_new(module, :runtime, references)

  defp add_reference(references, module, :compile) when is_atom(module),
    do: :maps.put(module, :compile, references)

  defp add_remote_dispatch(state, module, fa, line, mode) when is_atom(module) do
    map_update(mode, %{module => %{fa => [line]}}, state, fn mode_dispatches ->
      map_update(module, %{fa => [line]}, mode_dispatches, fn module_dispatches ->
        map_update(fa, [line], module_dispatches, &[line | List.delete(&1, line)])
      end)
    end)
  end

  defp add_import_dispatch(state, module, function, arity) do
    directives =
      add_dispatch(state.directives, module, :import)
      |> add_dispatch({module, function, arity}, :import)

    # Always compile time because we depend
    # on the module at compile time
    references = add_reference(state.references, module, :compile)
