简体   繁体   中英

JavaScript intellisense not working with simple function?

In VS 2012, intellisense of jquery works but not my custom function, Here is a simple example,

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,

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

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.

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