因此,我发现函数中 return 语句之后声明的变量不会出现在 VS2013 智能感知中。
一个例子:
function getService(){
var service = {
getNames: getNames
};
return service; //<--intellisense not working on variables declared
// below this line
function getNames(){
var test = {
first: '',
second: ''
};
test. //<-- here intellisense does not show
// either the test variable or the first or
// second properites of the object.
}
}
有谁知道解决这个问题的方法吗?
还是我只需要重新排列代码并将 return 语句放在最后?