We should parse doc blocks as markdown comments:
cc @let-def about Merlin's end here. Who should be responsible for stripping leading stars from ppx comment attributes? Who should be responsible for converting it from markdown to ocamldoc?
@rgrinberg Why does omd still depend on oasis?
@rrdelaney will look into this (I'll remove this comment if that changes)
I've forked Omd to fix some bugs, and I use it in both redoc and reason-language-server. Given that ocaml's parser doesn't strip leading stars, I don't think reason's should either. Let's have the AST directly represent the code that was written.
When refmt is printing out reason syntax code, then it can do parsing of the docblock so that it can reflow things. But I don't think it should do any doccomment processing one the "parse" side of things.
It would be really cool if markdown code examples within comments were also run through refmt themselves.
Yeah that should be totally doable 馃憦 (again we'd only incur the parsing + processing cost on the "print to reason" side, so compile times shouldn't be impacted)
for the record here's my vendored version of omd https://github.com/jaredly/reason-language-server/tree/master/omd
@bordoley Great idea!
@jaredly: One problem is that right now merlin doesn't know if your ppx attribute doc comments were written in ocamldoc format or markdown format and it assume ocamldoc format so it doesn't strip the leading stars when rendering markdown comments in Atom. What do you suggest doing?
Would it be worth supporting an attribute to specify the format of doc comments? Something like that could be coordinated with the odoc folks.
@jordwalke what I do in my language server is assume it was markdown if it came from a .re(i) file, and assume ocamldoc if it came from a .ml(i). Seems to work quite well
That is probably a pretty accurate heuristic!
I've split this task into two separate ones:
Let us know if anyone wants to help with this one. It will be greatly appreciated.