ex_doc icon indicating copy to clipboard operation
ex_doc copied to clipboard

Behaviour signatures removed from Elixir?

Open jwarwick opened this issue 12 years ago • 6 comments

In elixir-lang/elixir@d33463dcd5e36b4c5f8190dbd69d4f34cf757e36, @josevalim removed the signature info from the Behaviour docs. This is generating a match error in ExDoc.Retriever.get_callback/4, where we use the signature information in the ExDoc.FunctionNode. Does this information live some other place in the beam file? Or is there a better way to capture it for the docs?

jwarwick avatar Apr 04 '14 01:04 jwarwick

The information is gone. I am planning to update ex_doc when it is close to release v0.13. :)

josevalim avatar Apr 04 '14 07:04 josevalim

Ah, the signature information can be retrieved from BEAM files, similar to how we retrieve specs.

josevalim avatar Apr 04 '14 07:04 josevalim

A pull request is welcome if you are planning to tackle this. :)

josevalim avatar Apr 04 '14 07:04 josevalim

Is this functionality something that should live in Elixir or pull it out into ex_doc? I might have cycles to look at it sometime soon.

jwarwick avatar Apr 04 '14 20:04 jwarwick

We already get the callbacks with Kernel.Typespec.beam_callbacks(module), we should probably just raise if there is a behaviour doc and we can't find the appropriate callback. When printing the docs, we can simply print the callback (instead of the previous signature we had).

josevalim avatar Apr 05 '14 16:04 josevalim

Thanks @jwarwick!

josevalim avatar Apr 05 '14 16:04 josevalim