https://toitlang.org/ logo
How to present function comments?
# help
a
I'd like to clarify how the functions/methods work, but I don't see anything official. Did I miss it? Example:
Copy code
cpp
/**
 * @fn float ** merci(int*, double**,char*,int)
 * @param   \b param1 
 * @param   \b param2
 * @param   \b param3
 * @param   \b param4
 * @brief   votre briefing concernant la fonction
 * @details  les détails de la fonction
 * @return  ce qu'elle retourne
 */
k
Take a look at https://docs.toit.io/language/sdk/toitdoc and let us know what kind of guidance is missing!
You can refer to parameters using
$param1
, etc.
We typically write more prose with less rigid structure, so we would usually try to explain what the method does and returns in words - referring to the specific parameters in the text.
a
I see, because I noticed that the suggestions for functions when using them are very basic. You constantly have to go and consult the definition.
k
That's good feedback, thanks.
a
Optional parameters can be displayed with "--" but that's about it. Thank you for taking the time to answer all these questions ^^
I'm not comfortable with all this in other languages. I admit that for me it would be enough for the editor to display the function definition with the comment preceding it.
f
That's a limitation of the LSP server. It's on my to-do list, but not yet on the top