Is there a vsdoc for DataTable so I can get intellisense for VisualStudio?

Is there a vsdoc for DataTable so I can get intellisense for VisualStudio?

patriklindstrompatriklindstrom Posts: 15Questions: 0Answers: 0
edited May 2012 in General
See for example: http://appendto.com/community/jquery-vsdoc
the vsdoc version of a javascript allows Visual Studio to use Intellisense for example jQuery development. The vsdoc file contains XML annotations, within JavaScript comments, which allow Visual Studio to parse, interpret and provide Intellisense while working with JavaScript files. I have not found any vsdoc for datatables. Or does anyone know of a tool to automatically create it from perhaps the jsdoc for datatables.

Replies

  • allanallan Posts: 61,635Questions: 1Answers: 10,092 Site admin
    Hi,

    I don't have a vsdoc version of DataTables, but as you rightly say there is a wealth of information in DataTables as JSDoc comments which could be parsed out and put into the vsdoc format - indeed I already do that for the SQL that powers the documentation on this site.

    Do you know if the vsdoc comments much be inline with the code, or can Visual Studio simply take a file what is full of suitable comments and use that? If so, I can put a script together that will do exactly that (and thus also keep it up-to-date with each DataTables release).

    Regards,
    Allan
  • patriklindstrompatriklindstrom Posts: 15Questions: 0Answers: 0
    edited May 2012
    the VSDoc for example the jquery is
    [code]
    var jQuery = function (selector, context) {
    ///
    /// 1: Accepts a string containing a CSS selector which is then used to match a set of elements.
    ///
    1.1 - $(selector, context)
    ///
    1.2 - $(element)
    ///
    1.3 - $(object)
    ///
    1.4 - $(elementArray)
    ///
    1.5 - $(jQuery object)
    ///
    1.6 - $()
    ///
    2: Creates DOM elements on the fly from the provided string of raw HTML.
    ///
    2.1 - $(html, ownerDocument)
    ///
    2.2 - $(html, props)
    ///
    3: Binds a function to be executed when the DOM has finished loading.
    ///
    3.1 - $(callback)
    ///
    ///
    /// A string containing a selector expression
    ///
    ///
    /// A DOM Element, Document, or jQuery to use as context
    ///
    ///

    // The jQuery object is actually just the init constructor 'enhanced'
    return new jQuery.fn.init(selector, context, rootjQuery);
    };
    [/code]

    So it seems inline. But I do not if it is enough too just have the declaration of the function and the comments. I'll investigate further. The best as you say is if could be converted automatically from the JSDoc.

    Here is more info on Visual Studio and intellisense
    http://www.codeproject.com/Articles/36564/Friday-Tip-06-We-love-Visual-Studio-Intellisense-L
    and
    http://weblogs.asp.net/bleroy/archive/2007/04/23/the-format-for-javascript-doc-comments.aspx
    and
    http://www.scottlogic.co.uk/2010/08/vs-2010-vs-doc-and-javascript-intellisense/
  • patriklindstrompatriklindstrom Posts: 15Questions: 0Answers: 0
    Google is our friend.
    Here seems to be a conversion tool.
    https://code.google.com/p/jsdoc-toolkit-vsdoc/
    But I cant download it.
  • allanallan Posts: 61,635Questions: 1Answers: 10,092 Site admin
    Fantastic - I'll download Visual Studio Express and give this a blast. I'll let you know how I get on :-)

    Regards,
    Allan
  • allanallan Posts: 61,635Questions: 1Answers: 10,092 Site admin
    Hi,

    I've downloaded and been working with DataTables and the JSDoc -> VSDoc converter you pointed out and this is what I've come up with: http://datatables.net/dev/vsdoc.zip . Might you be able to give it a blast and see how it goes for you?

    I must admit I'm not convinced that it is going to be wholly successful on that first pass as it doesn't appear to have included the API methods - basically JSDoc 3 which I use for DataTables has been updated in quite a few areas, and the JSDoc Toolkit isn't picking everything up. However, if it looks like it is being successful then I'll see if I can get it working 100%.

    Regards,
    Allan
This discussion has been closed.