On some methods, Visual Studio Code ( VSC ) automatically describes the intellisense suggestions like this :

How can this be done for custom code, I tried finding out on the source for this name interface: and found this piece of code :
/** Returns a string representation of a function. */
toString(): string;
So I tried adding the same to my class method:
/** Returns a string representation of a function. */
nowUTS()
{
return Math.round(Date.now()/1000);
}
But when VSC gives this method as a suggestion, I only get this visually:

How should I document my class methods for visual studio code intellisense to pick up the description ?
You should install jsdoc add in

Link download https://marketplace.visualstudio.com/items?itemName=stevencl.addDocComments
More at https://code.visualstudio.com/Docs/languages/javascript#_jsdoc-support
You should place the documentation comment above the function nowUTS(). For reference check JSDoc documentation: https://jsdoc.app/about-getting-started.html
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With