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

Cannot add documentation for functor arguments #1047

Open
clecat opened this issue Nov 28, 2023 · 1 comment
Open

Cannot add documentation for functor arguments #1047

clecat opened this issue Nov 28, 2023 · 1 comment

Comments

@clecat
Copy link

clecat commented Nov 28, 2023

While writing the documentation for a project, it appeared to me that odoc was generating a category for the parameters of my functor:

image

However, even when trying to add a comment to my functor argument (I tried several things), odoc seemed to ignore them while ocamlformat was giving me the following error:

[unexpected-docstring]: unattached documentation comment (ignored) Hint: (Warning 50) This file contains a documentation comment (** ... *) that the OCaml compiler does not know how to attach to the AST.

Would it be possible to add the support for such a thing ? The error from ocamlformat & a private disussion with @Julow seems to indicate that it would not be that easy and would require some changes to the compiler, but it would be a really nice addition to be able to directly comment them and use the Parameters category rather than use @param inside the functor's documentation.

@Julow
Copy link
Collaborator

Julow commented Nov 28, 2023

I think that documentation comments on functor parameter definitions would be a good addition to the language. But until this is implemented and accepted upstream, perhaps we could handle @param tags specifically in cases of functors ?

I suggest attaching @param under the corresponding argument in the "Parameters" section. A warning would be generated for @param tags that do not name an existing parameter but it wouldn't be dropped.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants