Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Comment javascript methods in Visual Studio

Is there a way to insert a snippet for XML comments in javascript in Visual Studio 2010 with automatically generated parameters?

If I type /// here...

function foo(a, b){

...it should change to this (depending on the parameters):

function foo(a, b){
    /// <summary>$cursorhere</summary>
    /// <param name="a" type="string">Param a</param>
    /// <param name="b" type="string">Param b</param>
    /// <returns type="function">Return function</returns>

So it would be similar to the snippet generation if I'm in C# code.

EDIT

To clarify, I just want to know if there is a shortcut or existing plugin to achieve the functionality mentioned above approximately.

like image 514
Marc Avatar asked Sep 19 '12 06:09

Marc


People also ask

How do I comment a JavaScript file in Visual Studio?

A comment stub is created when a triple-slash ("///") is added on a new line. Save this answer.

How do I keep comments in Visual Studio?

Comment Code Block Ctrl+K+C/Ctrl+K+U If you select a block of code and use the key sequence Ctrl+K+C, you'll comment out the section of code. Ctrl+K+U will uncomment the code.


1 Answers

You can make a code snippet, but that seems too much trouble to me. I use JScript vsdoc Stub Generator, it generates XML comments like these ones:

enter image description here

This extension's goal is to provide a simple way to add vsdocs to JavaScript that acts similar to other XML comments provided by Visual Studio. A comment stub is created when a triple-slash ("///") is added on a new line.

like image 136
Evandro Silva Avatar answered Sep 18 '22 18:09

Evandro Silva