简体   繁体   English

JavaScript intellisense无法使用简单功能吗?

[英]JavaScript intellisense not working with simple function?

In VS 2012, intellisense of jquery works but not my custom function, Here is a simple example, 在VS 2012中,jquery的智能感知有效,但我的自定义函数无效,这是一个简单的示例,

window.g = {};

//#region Public functions

/// <signature>
///   <summary>This function will return the current page mode.</summary>
///   <returns type="bool" />
/// </signature>
g.isPageInEditMode = function () {
    return true;
}

This function does shows me summary. 此功能确实向我显示了摘要。

Putting these special comments in a separate file called XXX.intellisense.js solved the issue, 将这些特殊注释放在另一个名为XXX.intellisense.js的文件中即可解决此问题,

intellisense.annotate(g, {
    'isPageInEditMode': function () {
        /// <signature>
        ///   <summary>This function will return the current page mode.</summary>
        ///   <returns type="Boolean" />
        /// </signature>
    }
});

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM