Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Eclipse - supporting outline view with require.js define(...)

I have a large code writing within define(...) as the following format -

define(['angular'], function(angular) {
        function foo () {
            console.log("Hi") ; 
        }
        function foo2 () {
            console.log("Hi") ; 
        }
        function foo3 () {
            console.log("Hi") ; 
        }
} )

The Eclipse is missing all the outline view output for this format , mean - showing nothing .

How to make it supporting this format , mean - direct me to all function and variables declaration ?

Here my current outline view is attached -

enter image description here

like image 629
URL87 Avatar asked Jan 12 '15 16:01

URL87


2 Answers

JSDT Plugins which is the default Eclipse plugins for JavaScript doesn't support RequireJS. I suggest you that you try tern.java (I'm the author of tern.java) which gives a support for RequireJS. You will benefit with RequireJS completion, hyperlink, hover, validation.

I suggets you that you install AngularJS Eclipse 0.8.0 (not released) which is based on tern.java (as it seems you are using angular). You will have again Outline problem (tern.java doesn't fix that), but don't hesitate to create issues with your idea to improve tern.java.

like image 200
Angelo Avatar answered Oct 05 '22 08:10

Angelo


You may also want to try out the Aptana Studio plugin. Their plugin offers a lot of nice front-end web development tooling.

like image 34
Joe Johnson Avatar answered Oct 05 '22 10:10

Joe Johnson