Reputation: 5545
If I have a standard javascript class with the code:
class MyClass {
// My functions here
}
Then code folding works as expected, and eclipse can fold each method in the class.
But If i want to export the class by adding the keyword "export" as this:
export class MyClass {
// My functions here
}
Then eclipse removes the option to fold methods. Now it can only fold the entire class and nothing else. So is there any way to have "normal" class folding in eclipse, even if using the export keyword?
(I don't understand why export should ever change folding rules).
Upvotes: 1
Views: 35
Reputation: 34135
Folding works based on the abstract syntax tree (AST). As you can see in the Outline view, the keyword export
incorrectly turns the AST class node into an "export declarations" node.
You could report the bug to Eclipse or/and switch from Eclipse JavaScript Development Tools (JSDT) to Eclipse Wild Web Developer, which requires Node.js to be installed and may replace JSDT in the future (Eclipse Wild Web Developer uses the Language Server Protocol (LSP) and is developed more actively).
Upvotes: 1