ExtJS and Visual Studio – can you help?


This post presents a C# program to convert ExtJS JavaDoc comments to XmlDoc comments so at least some ExtJS commentary is available within Visual Studio. Can you suggest ways to improve the output? By improve, I mean ways additional comments can be created so VS picks them up or how the generated code can be modified to increase the use of functions.

Download the project here

Note: the program could have been created using JavaScript or PHP or anything else but I prefer C# so suggesting a different language does not count.

I guess it’s no surprise that Microsoft would do something different.

In this case it’s intellisense for JavaScript. Intellisense, Code Complete (or whatever you want to call it) existed for JavaScript long before Microsoft added such a feature to Visual Studio 2008. Other tools supporting intellisense for JavaScript have used the JavaDoc style of adding comments to the source code:

1
2
3
4
/**
 * Some remark
 * @param {type} name comment  ... 
/*)
/**
 * Some remark
 * @param {type} name comment  ... 
/*)

These comments can cover prototypes, classes, functions and members.

But Microsoft decided to use a different style and stick with their ‘XmlDoc’ as used across most VS supported languages:

1
2
/// <summary>Blah, blah</summary>
/// <param name="p1" type="t">A useful note</param>
/// <summary>Blah, blah</summary>
/// <param name="p1" type="t">A useful note</param>

So there’s a rationale but it does mean comments in third party libraries are useless (unless they also use the XmlDoc style). Also, VS intellisense for JavaScript only supports functions and the comments have to appear *inside* the function not before the function declaration.

ExtJS

I want to be able to use ExtJS. It seems like a robust framework for creating JavaScript-based application. But I want to be able to use Visual Studio as C# will be used for creating server components. The ExtJS comments (in ext-all-debug-w-comments.js) are all JavaDoc style. So I’ve created a C# program to create additional comments in the XmlDoc style.

The script works well enough. By necessity it converts/creates only function comments because Visual Studio seems to use only these.

But some questions for you:

  • Do you know different?
  • Has someone done a better job at converting ExtJS comments for use with Visual Studio?
  • Are there other conversions which should be included?

Information and Links

Join the fray by commenting, tracking what others have to say, or linking to it from your blog.


Other Posts

Write a Comment

Take a moment to comment and tell us what you think. Some basic HTML is allowed for formatting.

Reader Comments

Be the first to leave a comment!