Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Generate documentation comments for typescript in Visual Studio

When working in C# using ReSharper + StyleCop I can auto generate basic documentation comments for methods, which looks something like:

    /// <summary>
    /// The login.
    /// </summary>
    /// <param name="returnUrl">
    /// The return Url.
    /// </param>
    /// <returns>
    /// The <see cref="Task"/>.
    /// </returns>

which I can then add extra detail into.

Is there a similar tool for TypeScipt which will generate the JSDoc comment sections so I can simply fill in the details?

like image 844
Antony Jones Avatar asked Nov 13 '14 09:11

Antony Jones


People also ask

How do you comment multiple lines in TypeScript?

Multi-Line comments in Typescript This can be denoted by using /* */.

Does Visual Studio support TypeScript?

TypeScript support By default, Visual Studio 2022 provides language support for JavaScript and TypeScript files to power IntelliSense without any specific project configuration. For compiling TypeScript, Visual Studio gives you the flexibility to choose which version of TypeScript to use on a per-project basis.


2 Answers

ReSharper has a backlog item for this - Automated JavaScript Comments.

At the moment, you just have to type /** and then enter them yourself.

There are some extension that create vsdoc and jsdoc comments*.

*JSDoc added in v2.

like image 159
Fenton Avatar answered Oct 23 '22 10:10

Fenton


There's a nice little extension in the VS Code MarketPlace called Document This. Try that. Other options are : Comments in Typescript by S.Albert and DocStubsJs by Michael Obermeyer

like image 39
Anish Reddy Avatar answered Oct 23 '22 10:10

Anish Reddy