Closed gnahtb closed 2 years ago
Millet does support this, you just have to write the comment in a certain way: https://github.com/azdavis/millet/blob/main/docs/manual.md#doc-comments
Weirdly that doesn't work for me. Do I have to enable something in the extension settings? I'm running VSCode 1.71.2 on Windows and the Millet version is v0.3.10.
Also, I think it is nice if we can define some convention for our docstrings. For example, in the above screenshot, we see that the Java extension uses @param
to denote the definition of a function parameter.
Seems like hovering for doc works for everywhere except the def site itself. If you're hovering the def site itself, you have the comment right in front of you anyway, so that seems not too bad.
As for conventions, 🤷 . You can use whatever style you want, as long as it's Markdown. There are other existing ML doc comment styles, but I just 'invented' one for the purposes of Millet.
I can work to improve the hovering for the def site if no one plans to do it. It will take me a lot of time since I'm unfamiliar with VSCode API, but this seems low-priority, so I hope it won't matter much.
Closing this since the original issue itself (doc comments) is resolved. If you want to send a patch to implement hover for doc on the def site feel free to.
I notice that currently the language server doesn't support function docstring popups. If we look at other language servers, for example, Java, we see that if the user specifies some comments right on top of the function, when the user hovers over the function name, a popup showing the comments appears.
I think this feature is useful, considering that a lot of users usually write some comments about the function usage.