Appcelerator Titanium vsdoc for Visual Studio

Click here to get the updated file, otherwise read on 🙂

If you just want the vsdoc, here you go: Titanium-vsdoc.js

This weekend, I finally broke down and [re]learned Python. Got acquainted with Git (which I am really starting to dig). And for the trifecta, signed up for github. Why? Well, I had a sudden burst of inspiration while trying to write a walk through on how to generate a vsdoc using my C# app. About half way through I realized this was just too much work; not to mention really lame. So I buckled down for a few hours and got something that is good enough to throw out to the world. This time…it’s open source (David Caruso stole my keyboard…I swear!).

Changes from v1:

Code to generate the vsdoc is released
Includes Titanium objects
Added module events
Types now return the correct type. (ie. Function returns an array, VS will treat it as an array)

Unfortunately, Visual Studio doesn’t support comments for objects. Which, of course, a large portion of the vsdoc is made up of objects.

Anyway, if you’re interested you can view my forked project here: JeremyMelton/titanium_mobile

This has now been merged into the titanium mobile master: https://github.com/appcelerator/titanium_mobile

How to use the vsdoc

  1. Download the vsdoc
  2. Add the Titanium.vsdoc.js to your project
  3. In the [js] file you want to use Titanium add the following line to the first line of the file.
    ///<reference path=”~/path/to/Titanium.vsdoc.js”/>
  4. Use it!

 

Any feedback is welcome.

Author: Jeremy

See all posts by (34)

3 comments until now

  • You have done a great job for visual studio lover.
    But I just wonder why you just return {} in create function instead of its class

    createView: function (parameters) {
    ///create and return an instance of Titanium.UI.View
    ///(optional) a dictionary object properties defined in Titanium.UI.View
    ///
    return Titanium.UI.View;
    }

    It has better inteli-sense support in its assign object.

    By Sam Wong March 24, 2011 @ 12:54 AM
  • The docgen.py file uses the generated tdocs (titanium_mobile/apidoc) to get the information for the vsdoc. In most (all?) of the tdocs the return type for a function is specified as a just a plain ol’ object. Even in Appcelerator’s docs the return type is specified as ‘object’.

    Returning the actual object (ie Titanium.UI.View) would make life REALLY simple. It’s not just possible without hacking in some parsing of the comments (dirty and not reliable) or changing the code comments. I had aspirations to go through the code comments and update this myself. Unfortunately, other projects take precedence over my fun stuff for the time being.

    By Jeremy March 25, 2011 @ 10:09 AM

Leave a Reply