简体   繁体   中英

Documentation of OCaml code in Eclipse

I'm using Eclipse with the OcaIDE-Plugin to write my ocaml-project.

I have written several ocaml-functions that I want to document (comment, return values and params).

I've created my documentation in the .ml-files like described in this link: http://caml.inria.fr/pub/docs/manual-ocaml/ocamldoc.html

Here is an example of one function:

(** sorting tuples where first element is key *)
let my_comp x y = (*Some code*)

Unfortunately, my comments don't show up, when I press F2 at one of the functions, it only shows the name and the file it is contained.

When writing comments in an mli-file, it works as expected, but i also want to document "private" functions that are not accessible from the outside. Can I define functions in the mli, that are NOT accessible from the outside, just for the documentation?

How can I make Eclipse to show my documention?

Well, as you said, you would like to show the documentation but not export the function out of the module. That, sadly, won't work.

I guess OcaIDE can be considered as incomplete but it doesn't look like it's something people care about (I don't know a single person working on OcaIDE). If you like having autocompletion etc, maybe try to program with emacs and install merlin (look, I found the perfect post for you : here )

As for the suggestion of defining a function in the mli not accessible from the outside, it's completely opposed to why mli files are created, so don't expect that to be possible. ;-)

I hoped I've been able to help you.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM