相关疑难解决方法(0)

如何在Eclipse"Outline View"中使JavaScript函数可见?

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

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

我可以将所有函数标记为构造函数,但它是无效的方法.

坏大纲的截图

// --- 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() {
}
Run Code Online (Sandbox Code Playgroud)

我测试了所有过滤选项,jsdoc和研究Eclipse首选项,但不知道如何something2在大纲视图中显示?

第二次尝试

javascript eclipse jsdt

11
推荐指数
1
解决办法
5069
查看次数

_Best实践JSDoc'ing以"揭示模块模式"风格编写的Javascript文件?

我的大多数Javascript函数都相对简单,并且需要它们的副作用:我使用jQuery来操作DOM或进行Ajax调用.我更喜欢用"揭示模块模式"风格编写我的函数.

刚刚发现 JSDoc-注释Javascript文件有一个好处:借助注释,Eclipse的JS开发工具可以解析我的JS文件并填充Eclipse Outline View(否则它将是空的).

现在我想知道注释的优点或优点是什么?我不习惯它.

谷歌JS风格指南说明了一些关于JSDoc:建议只使用可用标签的子集,以及其他建议.

现在,我想出了这个模板(这段代码没有做任何有用的事情):

/**
 * @fileOverview Say something meaningful about the js file.
 * @author <a href="mailto:my@email.net">My name</a>
 * @version 1.0.1
 */


/**
 * @namespace What the namespace contains or which apps/webpages use it
 */
if (!window['my']['namespace']) {

    window['my']['namespace'] = {};    
my.namespace = (function() {
    /**
     * Documentation string...
     * @memberOf window.my.namespace
     * @private 
     */
    var clear = function(){};


    /**
     * Documentation string...
     * …
Run Code Online (Sandbox Code Playgroud)

javascript eclipse documentation documentation-generation jsdoc

10
推荐指数
1
解决办法
7536
查看次数