erlang / otp

Erlang/OTP
http://erlang.org
Apache License 2.0
11.43k stars 2.96k forks source link

Extracting EEP 059 doc attributes for private functions #9022

Open robertoaloi opened 3 weeks ago

robertoaloi commented 3 weeks ago

In EEP 059 we state that:

The -doc attribute can be used for private function as well, so that tools and IDEs can provide docs if the user wants them to.

But, from what I can tell, the current mechanism to extract -doc attributes is currently located in the private (as in -moduledoc false) beam_doc module, which only extracts them for exported functions.

Language servers often work with the source code directly (except for OTP libraries or dependencies), so having a defined API to extract doc attributes would be useful.

garazdawi commented 3 weeks ago

Adding an option to the compiler to include private functions/types sounds like a good idea to me. Will you make a PR?