Jake Tyler Jake Tyler - 1 year ago 92
Javascript Question

Eclipse JavaScript Fold Function Ability Disappeared Even With Folding Enabled

For a while now I could collapse and expand functions without any problems in my JavaScript files. Suddenly all of the +/- buttons next to the line numbers disappeared for all functions. Folding for JavaScript is enabled and it is clear there is space next to the line numbers for the buttons.

I'm using Eclipse Java EE IDE for Web Developers, Version: Neon.3 Release (4.6.3)

Answer Source

The problem was that I had just created a new function and I had included in the function parameters the var declaration:

// No functions could be folded
function foobar(var foo, var bar) {
...
}

Removing the var for each parameter solved the folding problems:

// All functions can now be folded again
function foobar(foo, bar) {
...
}
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download