Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extracting EEP 059 doc attributes for private functions #9022

Open
robertoaloi opened this issue Nov 5, 2024 · 1 comment
Open

Extracting EEP 059 doc attributes for private functions #9022

robertoaloi opened this issue Nov 5, 2024 · 1 comment
Assignees
Labels
team:VM Assigned to OTP team VM

Comments

@robertoaloi
Copy link
Contributor

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.

  • What's the recommended API for language servers to extract doc attributes, since beam_doc is undocumented and could change at any time?
  • Maybe we could make beam_doc accept an option to regulate this behaviour? (Right now it would be possible to add an export_all attribute to the AST, but it feels like a hack).
@IngelaAndin IngelaAndin added the team:VM Assigned to OTP team VM label Nov 6, 2024
@garazdawi
Copy link
Contributor

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

@garazdawi garazdawi self-assigned this Nov 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
team:VM Assigned to OTP team VM
Projects
None yet
Development

No branches or pull requests

3 participants