简体   繁体   English

javascript中的VS2013 intellisense

[英]VS2013 intellisense in javascript

So, I found out that variables declared after the return statement in a function do not show up in VS2013 intellisense. 因此,我发现在函数的return语句之后声明的变量不会显示在VS2013 intellisense中。

An example: 一个例子:

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.
  }
}

Any know a way to remedy this? 有什么办法可以解决这个问题吗?
Or do I simply have to rearrange the code and put the return statement in the end? 还是只需要重新排列代码并将return语句放在最后?

Your example works fine for me. 您的示例对我来说很好。

Try making sure you have intellisense enabled and there is no conflicting plugins. 尝试确保已启用智能感知,并且没有冲突的插件。

在此处输入图片说明

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

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