这是一些示例 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
}
}
当我做“val”时,视觉工作室不应该给我智慧吗?在“doSomething”函数中?我希望它能给我 field1 和 field2 作为选项,但事实并非如此。如果我输入“val2”,我会得到 field1 和 field2。所以当我创建一个与我在参数注释中指定的相同类型的新对象时,智能就会起作用。
任何想法我做错了什么或者这只是不支持?