【问题标题】:Code folding issue eclipse代码折叠问题eclipse
【发布时间】:2013-03-19 21:40:06
【问题描述】:

我在 Eclipse 折叠 javascript 代码时遇到问题,我不知道问题出在哪里。我正在构建游戏引擎,所以我有一个特定的对象构造函数,后跟一个计算帧速率的函数:

function Constructor() {
    //A whole bunch of code for this constructor

    this.method = function() {
        //A bunch of method code
        this.context.font = "blahblah";
    };
}

function calculateFrameRate(times) {
    //All the code for calculating framerate
}

无论出于何种原因,它给了我从 context.font 语句开始折叠的选项,并且它在帧率计算函数中一直折叠。这显然不是要折叠的有效代码块。关于问题可能是什么的任何想法?

【问题讨论】:

  • 这是 Eclipse 的 JavaScript 编辑器中的一个错误。你的代码没有错。

标签: javascript eclipse collapse folding


【解决方案1】:

尝试将this.method = function() { 中的函数命名为this.method = function method() { 之类的名称

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2012-01-06
    • 2011-10-15
    • 2012-08-15
    • 2011-07-23
    • 2016-10-26
    • 2012-01-25
    • 1970-01-01
    相关资源
    最近更新 更多