Automatic documentation for method arguments
Hi Community,
Can anyone point me to the docs that show how to add automatic class documentation for the arguments used in a method call? I can auto document the class, methods, properties etc. with the "///" but can't figure out how to get the nice argument documentation for the arguments used when calling a method.
Thanks in advance
I'm not sure what you mean with "the nice argument documentation for the arguments".
Do you have an example?
Hi Enrico, what I thought I had seen somewhere worked like this scenario: you are writing code to call a previously defined method, and as you work through the arguments in your IDE of choice (mine = VSCode) you are presented with help strings for the specific argument you are currently working on for the call, as opposed to a a general help text that explains the method and its input arguments. I went looking for an example and couldn't find one, so perhaps I was imagining it or had my wires crossed for IDEs / Languages 🤷♂️
An example would be helpful .... typically I will put argument documentation in my /// comment for the method, and use the <var>arg</var> tags to change the styling of the argument names in the method documentation to make it clear that it's referring to the argument.
Thanks Ben. See my note to Enrico. The missing example may not exist 🤦♂️.
Will have to try the var tagging.
Got it - that would be a really great enhancement request though! I would love to see that in action in VSCode :)
If you mean something like this?
This is essentially only displaying a "good" functional spec definition plus /// supplied documentation.
That's the framework for sure Timo. Envisioned something that gave more specific hinting as you worked through the argument list. Like a /// for each argument specifically. I am pretty sure that I just imagined it, but like @Ben Spead said, It would be great action in VS Code. May have to go down the VSCode Rabbit Hole now.
nice visual :)
and that screen capture demonstrates why good class documentation especially method descriptions are super valuable including when you are using VS Code.
Absolutely! In fact, I'm planning a project for my team so that our CICD pipeline will throw a failure if someone checks in a method, property, parameter in a class without Documatic (///) content. Of course, just because comments exist doesn't mean it is good, but that's at least a place to start!