How to make JavaScript function visible in Eclipse “Outline View”?

荒凉一梦 提交于 2019-12-06 19:41:36

问题


I have such code but can not turn on outline of function if it defined in anonymous function - there is not problem with class.

How can I outline something2 - please share some hints?

I can mark all function as constructors but it is invalid approach.

// --- start of track event ---
// required debug.js
(function (window) {

/**
 * @memberof erest.track_event
 */ 
function something2() {
}

/**
 * @memberof erest.track_event
 * @constructor
 */
function something3() {
}
}(window));
//--- end of track event ---

function something1() {
}

I was tested all filtering options, jsdoc and study Eclipse preferences but has no idea what to do to make something2 visible in outline view?


回答1:


You have a small typo in the @memberOf annotation. Change to a capital O and it should work just fine:

(function(window) {

  /**
   * @memberOf erest.track_event
   */
   function something2() {
   }

  /**
   * @memberOf erest.track_event
   * @constructor
   */
   function something3() {
   }

}(window));

function something1() {
}

Remove the @constructor annotation, if appropriate, to get something3() in the outline and not the constructor function.

Here is a similar question asked. Follow the link in the answer to get some more information.



来源:https://stackoverflow.com/questions/23544328/how-to-make-javascript-function-visible-in-eclipse-outline-view

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