Oskar Pålsson
Oskar Pålsson

Reputation: 129

Eclipse - Fold jQuery functions

My javascript file is getting longer and longer, and I need to control my code.

I have jQuery functions written like this:

jQuery.fn.myFunction = function(){

}

Is there a way to fold/collapse these code blocks in Eclipse?

Upvotes: 0

Views: 1898

Answers (2)

my name here
my name here

Reputation: 42

One work-around in Eclipse that has worked for me is to give the function a name, even if you don't use it. So,

jQuery.fn.myFunction = function whatever(){ ... }

Upvotes: 2

Rian Schmits
Rian Schmits

Reputation: 3206

When you install the JavaScript Development Tools from the Eclipse Web Tools Platform you get code folding for Javascript (plus syntax highlighting). You can install it by selecting Install New Software... in the Help menu. Then search for Javascript and you'll find it.

Upvotes: 0

Related Questions