【发布时间】:2013-02-17 04:55:30
【问题描述】:
我有一个脚本 retry.js,其中包含:
function retryAjax(load, count, config) {
}
显然它有一个主体,但这并不重要,因为无论我是否在脚本中有主体,都会出现这个问题。
为了记录这个函数返回的对象,我还有一个辅助的-vsdoc.js文件,retry-vsdoc.js:
function RetryAjaxDeferred() {
/// <summary>Returned from retryAjax. A jQuery Ajax Deferred object extended to support failWillRetry()</summary>
this.done = function (success) {
/// <summary>A callback when the Ajax call succeeds.</summary>
/// <param name="success" type="Function">Success callback</param>
}
this.fail = function (error) {
/// <summary>A callback when the Ajax call fails permanently.</summary>
/// <param name="error" type="Function">Fail callback</param>
}
this.failWillRetry = function (willRetry) {
/// <summary>A callback when the Ajax call fails with retries pending.</summary>
/// <param name="willRetry" type="Function">Fail callback</param>
}
};
奇怪的是,如果我删除 -vsdoc.js 文件,Visual Studio 2012 中的 Intellisense 对 retry.js 工作正常(当然,我对它返回的内容没有真正的帮助)。如果我将 -vsdoc.js 保留在原位,则 Intellisense 不再可以使用 retryAjax 函数 - 它不会在键入参数时自动完成或显示 Intellisense 信息。然而,RetryAjaxDeferred 函数确实在 Intellisense 中变得活跃。
很明显,-vsdoc.js 文件中的某些内容以某种方式破坏了 retry.js 的 Intellisense,而没有破坏到足以防止其自身内容消失的程度。我做错了什么?
【问题讨论】:
标签: visual-studio-2012 javascript-intellisense vsdoc