   end
 
   defp to_hint(%{kind: :module, name: name}, hint) do
-    :binary.part(name, byte_size(hint), byte_size(name) - byte_size(hint)) <> "."
+    format_hint(name, hint) <> "."
   end
 
   defp to_hint(%{kind: :function, name: name}, hint) do
-    :binary.part(name, byte_size(hint), byte_size(name) - byte_size(hint))
+    format_hint(name, hint)
+  end
+
+  defp format_hint(name, hint) do
+    hint_size = byte_size(hint)
+    :binary.part(name, hint_size, byte_size(name) - hint_size)
   end
 end

      if docs = Code.get_docs(mod, :docs) do
        for {tuple, _line, _kind, _sign, doc} <- docs, doc != false, do: tuple
      else
        (mod.__info__(:functions) -- [__info__: 1]) ++ mod.__info__(:macros)
      end
    else
      mod.module_info(:exports)

  end

  defp format_expansion([uniq], hint) do
    case to_hint(uniq, hint) do
      ""   -> yes("", to_uniq_entries(uniq))
      hint -> yes(hint, [])
    end
  end

  defp format_expansion([first|_]=entries, hint) do
