如果我的方法包含一条语句..。
if (some-condition) {
return someObject.methodOne().methodTwo().methodThree().methodFour();
}
Eclipse格式“折叠”到..。
if (some-condition) {return someObject.methodOne().methodTwo().methodThree().methodFour();}
但是,如果我的方法包含多个语句.
if (some-condition) {
int a = 42;
return something;
如果我有一个包含以下代码的标准javascript类:
class MyClass {
// My functions here
}
然后代码折叠按预期工作,eclipse可以折叠类中的每个方法。
但是如果我想通过添加关键字" export“来导出这个类,如下所示:
export class MyClass {
// My functions here
}
然后,eclipse删除了折叠方法的选项。现在它只能折叠整个类,而不能折叠其他类。那么,有没有办法在eclipse中进行“正常”的类折叠,即使使用了export关键字呢?
(我不明白为什么导出要改变折叠规则)。
在java折叠文件中使用eclipse如果我试图在两个折叠方法之间编写一个方法,当我编写public并自动按空格键时,ide会在下面的方法中折叠单词public。
State initial
- public methodA()
- public methodC()
Step 1:
- public methodA()
public
- public methodC()
Eclipse bug
- public methodA()
- public methodC() //Error because public is declared t