In Visual Studio 2010 and 2012, the JavaScript editor supports displaying inline documentation for JavaScript things such as functions. However, Visual Studio didn't appear to ship with this documentation for JavaScript's own built-in parts.
Here's a specific example of what I want to achieve. If I access a String
's charAt
method, here's what currently happens:
For built-in .NET classes, Visual Studio provides documentation. I would like to have the same thing for JavaScript.
Regarding how to do this, I think it could be done by providing a JavaScript file that contains stubs documented using JsDoc or VsDoc. Then I could just tell Visual Studio to use it as a reference for IntelliSense. Unfortunately, I couldn't find any existing work that already did this.
In VS2012, you can create a JavaScript file with all your VSDoc documentation and then save it as a reference file.
To configure a reference file:
TOOLS > Options
from the main menu bar Text Editor > JavaScript > IntelliSense > References
Implicit (Web)
from the Reference Group drop-down list Add
In VS12, the magic file you need is ~/Scripts/_reference.js
Place lines like this, substituting the correct path, of course.
It should pick up the jQuery VSDOC if it is there.
/// <reference path="~/Scripts/Frameworks/Kendo/kendo.web.exploded.js"/>
/// <reference path="~/Scripts/Frameworks/jQuery/jquery.1.8.2.js"/>
/// <reference path="~/Scripts/kendoize/kendoize.js" />
/// <reference path="~/Scripts/kendoize/validation.js" />
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.