I have a custom javascript called chris-vsdoc.js
Im trying to get Visual Studio 2010 intellisense to display the sayHello function
var chris = new chris();
function chris() {
this.sayHello = function (message) {
/// <summary>
/// Shows a message in a dialog box, with an OK button.
/// </summary>
/// <param name="message">
/// message - the message to display
/// </param>
}
}
My other .js files have a reference in them list this
/// <reference path="../chris-vsdoc.js" />
Any ideas how to get intellisense working?
Is there something Im missing?
You can use virtual root (
~/) paths in the Intellisense reference directive, which has worked best for me in the past, e.g.:Also, you can mark up your actual
chris.jsfile with the VSDoc comments and reference that, rather than needing to have a separate VSDoc. Minification will strip out all the VSDoc information anyway since it’s just a regular JavaScript comment that begins with another/.I usually end up with a central
main.js(named based on the project, not “main”), and then severalmain.namespace.jsfiles that eventually all get combined into one (with “main”).main.jshas a/// <reference />to each of themain.namespace.jsfiles and then each of those has a single/// <reference />back tomain.js.Using that approach, I get correct, VSDoc-driven Intellisense for the entire group of files in any one of them.