I read beam-file chunks directly.
Code.fetch_docs/1 pulls the whole object code through
:code.get_object_code/1; seeking to the one chunk is ~2.7x
cheaper (851us -> 319us for Enum), and doc reads happen on every
dot keystroke and on app-wide coverage sweeps.
Public API
Summary
Functions
I return the docs_v1 chunk term for module, or :error.
I return mod.__info__(kind) or []: __info__/1 can raise for
some macro-only modules despite exporting it.
The shape of an exports-only entry: a runtime function with no textual def, carrying a synthesized source (with an @spec line when the BEAM knows one).
I return %{{name, arity} => formatted_spec_string} for every function the BEAM has a typespec for; used to enrich macro-generated entries that have no source.
Functions
I return the docs_v1 chunk term for module, or :error.
I return mod.__info__(kind) or []: __info__/1 can raise for
some macro-only modules despite exporting it.
The shape of an exports-only entry: a runtime function with no textual def, carrying a synthesized source (with an @spec line when the BEAM knows one).
I return %{{name, arity} => formatted_spec_string} for every function the BEAM has a typespec for; used to enrich macro-generated entries that have no source.