13

I like eclipse, and with some tweaking it can be used for javascript programming. There's syntax completion, linting, formatting, and there's "outlining", albeit only for simple javascript files.

What annoys me is that there is no "Outline View" for files that follow the "revealing module" design pattern. This happens to be my favorite coding style.

Is there a plugin somewhere that adds to Eclipse an "extended" outline view that is able to "see inside" the nested structure of a .js file written in the "revealing module style", showing the encapsulated private functions and members? (The normal "eclipse outline view is usually empty for this type of style).

knb
  • 9,138
  • 4
  • 58
  • 85

1 Answers1

9

Answering my own question, again:

The javascript functions inside the IIFE must be annotated in the JSDoc style, then they will appear in the outline view.

The whole process is described here, with screenshots:

http://www.kajabity.com/2012/02/how-i-introduced-jsdoc-into-a-javascript-project-and-found-my-eclipse-outline/

knb
  • 9,138
  • 4
  • 58
  • 85
  • Working off your example [on this question](http://stackoverflow.com/questions/12838536/best-practices-for-jsdocing-javascript-files-written-in-the-revealing-module), I finally got this working! I had to do a: `var namespace = {}; namespace = (function(){}());`, which finally brought all the pieces together and got the outline functioning correctly! Quite exciting. – Eric L. Nov 26 '13 at 14:57
  • Is there any similar advice for [Jasmine tests](https://jasmine.github.io/2.2/introduction.html) . The inline functions are in function call parameters. – Batandwa Mar 21 '15 at 04:25