问题
I copied a JavaScript file over from Visual Studio to a new WebMatrix 2 Beta project only to find out the vsdoc file wasn't being used for JavaScript Intellisense.
/// <reference path="jquery-1.6.4-vsdoc.js" />
JavaScript's core functions do show up in Intellisense, but it doesn't appear to pull additional data from vsdoc files.
Spoiler alert: I will be answering this myself to bring the answer from its current webmatrix.uservoice.com location to StackOverflow for anyone else with this issue. Please don't take offense to this.
回答1:
Since they are currently taking user input on desired features in WebMatrix 2 Beta, I pitched support for vsdoc JavaScript file references. The WebMatrix team responded that it was already supported but the syntax was different until they change it to be more consistent with the current Visual Studio syntax. It is only different by one word.
Works in WebMatrix 2 Beta (note "file" instead of "path")
/// <reference file="jquery-1.6.4-vsdoc.js" />
Note:
While the "path" syntax doesn't work in WebMatrix 2 Beta yet, the WebMatrix team seemed intent on supporting it going forward for consistency with Visual Studio. If, for some reason, someone is using the same *vsdoc.js file between a WebMatrix 2 Beta project and a Visual Studio project (or managing a a WebMatrix user's project in Visual Studio), you could simply cover both bases. The WebMatrix "file" syntax does not appear to be supported by Visual Studio 2010.
/// <reference path="jquery-1.6.4-vsdoc.js" />
/// <reference file="jquery-1.6.4-vsdoc.js" />
Additional Note:
WebMatrix 2 Beta does not appear to support the new paragraph-sectioned (<para>
) vsdoc files.
来源:https://stackoverflow.com/questions/7742313/how-do-i-get-javascript-intellisense-from-vsdoc-file-references-in-webmatrix-2-b