How can I view the outline in eclipse when using the revealing module pattern?

徘徊边缘 提交于 2019-11-30 03:53:08

Add:

/**
 * @memberOf myNamespace
 */

before each function definition to restore the hierarchy.

You will find more interesting tags to document your code here:
How I Introduced JsDoc into a JavaScript project – and found my Eclipse Outline

one way is to call it as below. Define it as it is, but do not self execute it. Ensure the prototype is an empty object and then try calling it. It works the same way, but will restore the outline and you don't need to add comments in front of every function.

var myNamespace = (function()
{
  function myFunc1() {}
  function myFunc2() {}

  return {
    name: "myNamespace",
    myFunc1: myFunc1,
    myFunc2: myFunc2
  }
});
myNamespace.prototype = {};
myNamespace();

Not showing myFunc1() etc. in the outline appears to be a bug which is marked as fixed in 3.2. However it is not fixed in 4.2. It is certainly a huge pain when dealing with very large files of hundreds of functions, and only the var name shows up in the outline. I pray for it being fixed.

https://bugs.eclipse.org/bugs/show_bug.cgi?id=236202

https://bugs.eclipse.org/bugs/show_bug.cgi?id=281374#c1

/** * @memberOf myNamespace */ Did not work for me. When I add this above myFunc1(), it does not show it in the outline, even if I close and open the file.

Interestingly, 4 of my 20 or so functions do show up in the outline, but there is no difference between the ones which work and the ones which do not except the ones which work all have this.xxx in them (but if I add this.dummy; to invisible functions it does not help)

This semi works: myNameSpace.prototype = {}; myNameSpace;

But then you cant call its functions thusly: myNameSpace.myFunc1();

I'm working with eclipse/Kepler. Using the advice from above I managed to get the outline view. But proposals (Ctrl-space) didn't work. Some fn were visible, some not. No pattern to detect.

After reading http://usejsdoc.org/#JSDoc3_Tag_Dictionary I replaced all @memberOf by @memberof and now everything works as expected ('til the next problem arises ...)

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!