简体   繁体   中英

VS JavaScript intellisense with paramaters

here is some sample javascript:

SomeObjectType = function() {
}

SomeObjectType.prototype = {
    field1: null,
    field2: null
}

SomeOtherObject = function() {
}

SomeOtherObject.prototype =
{
    doSomething: function(val) {
        /// <param name="val" type="SomeObjectType"></param>
        var val2 = new SomeObjectType();
        //val2. shows intellisense correctly
        //val. does NOT


    }
}

Shouldn't visual studio be giving me intellisence when i do "val." inside the "doSomething" function? I would expect it to give me field1 and field2 as options, but it doesn't. I DO get field1 and field2 if I type "val2." so intellisence works when I create a new object of the same type that I specify in the param comment.

Any ideas what I am doing wrong or is this just not supported?

That is not supported in VS 2008. It will be supported in the next version.

In VS 2008, the XML comments are only used to generate tooltip information. And I think the tooltips may only be supported in referenced files.

This is supported on VS2010. But why only for the prototype methods? :(

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