     {:\\, [], [simplify_signature(left, i), right]}
   end
 
-  defp simplify_signature({:%, _, [left, _]}, _i) when is_atom(left) do
-    last = List.last(String.split(Atom.to_string(left), "."))
-    atom = String.to_atom(downcase(last))
-    {atom, [], nil}
+  defp simplify_signature({:%, _, [left, _]}, i) when is_atom(left) do
+    struct_name = camelcase_to_underscore(List.last(split(left)))
+    {:"#{struct_name}#{i}", [], nil}
   end
 
   defp simplify_signature({:=, _, [_, right]}, i) do

  defp simplify_signature(other, i) when is_binary(other),  do: {:"binary#{i}", [], Elixir}
  defp simplify_signature(_, i), do: {:"arg#{i}", [], Elixir}

  defp downcase(<<c :: utf8, rest :: binary>>) when c >= ?A and c <= ?Z do
    <<c + 32 :: utf8, downcase(rest) :: binary>>
  end

  defp downcase(<<c, rest :: binary>>) do
    <<c, downcase(rest) :: binary>>
  end

  defp downcase(<<>>) do
    <<>>
  end

  # Merge


    pair   = {name, arity}
    doc    = get_attribute(module, :doc)

    # Arguments are not expanded for the docs, but we make an exception for
    # module attributes and for structs (aliases to be precise).
    args = Macro.prewalk args, fn
      {:@,  _, _} = attr ->
        Macro.expand_once(attr, env)
      {:%, meta, [aliases, fields]} ->
        {:%, meta, [Macro.expand_once(aliases, env), fields]}
      x ->
        x
    end

    case add_doc(module, line, kind, pair, args, doc) do
