简体   繁体   English

带有参数的VS JavaScript智能感知

[英]VS JavaScript intellisense with paramaters

here is some sample javascript: 这是一些示例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." 我做“ val”时,视觉工作室不应该给我智慧吗? inside the "doSomething" function? 里面的“ doSomething”功能? I would expect it to give me field1 and field2 as options, but it doesn't. 我希望它能给我field1和field2作为选项,但事实并非如此。 I DO get field1 and field2 if I type "val2." 如果输入“ val2”,我确实会得到field1和field2。 so intellisence works when I create a new object of the same type that I specify in the param comment. 因此,当我创建与param注释中指定的类型相同的新对象时,智能就起作用了。

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. VS 2008不支持该功能。下一版本将支持该功能。

In VS 2008, the XML comments are only used to generate tooltip information. 在VS 2008中,XML注释仅用于生成工具提示信息。 And I think the tooltips may only be supported in referenced files. 而且我认为工具提示可能仅在引用的文件中受支持。

This is supported on VS2010. VS2010支持此功能。 But why only for the prototype methods? 但是为什么只为原型方法呢? :( :(

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

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