如果我有一个带有代码的标准javascript类:
class MyClass {
// My functions here
}
然后代码折叠按预期工作,eclipse可以折叠类中的每个方法 .
但如果我想通过添加关键字“export”导出该类,如下所示:
export class MyClass {
// My functions here
}
然后eclipse删除折叠方法的选项 . 现在它只能折叠整个 class ,而不是其他任何东西 . 那么即使使用export关键字,有没有办法在eclipse中进行“普通”类折叠?
(我不明白为什么导出应该改变折叠规则) .
1 回答
折叠基于抽象语法树(AST)工作 . 正如您在大纲视图中所看到的,关键字 export incorrectly turns the AST class node into an "export declarations" node .
您可以 report the bug 到Eclipse或/并从Eclipse JavaScript Development Tools (JSDT)切换到Eclipse Wild Web Developer,这需要安装Node.js并且可能在将来替换JSDT(Eclipse Wild Web Developer使用Language Server Protocol (LSP)并且更积极地开发) .