views:

429

answers:

3

I'm trying to get my Javascript documentation in order so that my comments can be used by Intellisense), for example

displayResults = function(msg, filterParams) {
    /// <summary>
    /// Gathers inputs and refreshes the grid and map
    /// </summary>
    /// <param name="msg">JSON data returned by GetConcessions ajax call</param>
    /// <param name="filterParams">JSON parameters that were originally passed to GetConcessions ajax call</param>
     ...
}

In VB, I use GhostDoc to make the process of adding structured comments easier. Is there anything like that to make my life easier in Javascript?

+6  A: 

I'd create a snippet in Visual Studio, inserting something like this:

/// <summary>xxxxxx</summary>
/// <param name="xxxxxx">xxxxxx</param>

Duplicate /// <param></param> according to arguments and then replace values.

All the x's are for easy selecting, copying and pasting.


On a side-note; I can't believe that Microsoft hasn't implemented the /// shortcut-snippet, to auto-insert documentation, like you are able to do in C#

roosteronacid
Thats a good idea, I'm stumped that they didn't implement the /// stuff for javascript too.
Zachary Yates
A: 

Well, without any third-party tools, I'd say try using the clipboard ring, but roosteronacid's idea about the snippet is probably quicker.

Hope that helps!

Zachary Yates
+2  A: 

Visual Studio 2010 will have snippets for JavaScript XML comments.

I wish I had a solution to give you for Visual Studio 2008.

By the way, the "param" tags also support a "type" attribute.

Alan Oursland