如何使JavaScript功能在Eclipse中可见“大纲视图”? [英] How to make JavaScript function visible in Eclipse "Outline View"?

查看:339
本文介绍了如何使JavaScript功能在Eclipse中可见“大纲视图”?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有这样的代码,但如果在匿名函数中定义函数,则无法打开函数的轮廓 - 类没有问题。

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

如何概述 something2 - 请分享一些提示?

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() {
}

我测试了所有过滤选项,jsdoc和学习Eclipse首选项,但不知道该怎么做,使 something2 可见大纲视图?

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?

推荐答案

您在 @memberOf 注释中有一个小错字。更改为资本O,它应该工作正常:

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() {
}

删除 @constructor 注释,如果适用,在outline中获取something3(),而不是构造函数。

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.

这篇关于如何使JavaScript功能在Eclipse中可见“大纲视图”?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆