Yojin Yojin - 1 month ago 13
Javascript Question

Autocompletion for multiple js files in Cloud9

I'm trying to move my workspace to c9 because the Ace editor's autocompletion really pleased me when I worked on NodeJS projects.

But now I would like to work on JS files client-sided. It is from this point autocompletion going wrong. Indeed, there is nothing such as "require" command in client-side JS inside of the JS files themselves (except using some plugins) to inform of the other source files used in.

So when I use, in one of my JS files, a function that is defined in an other file (even libraries, frameworks : jquery, etc), Ace notifies me that the function is not defined (cause it has no way to know that the function is defined in another file, I guess).

Here we go : is there some comment line I could put in my code, or some configuration of c9 I could set, to correct that behavior ?

Answer

To remove the errors and warning, you can just add the following line near the top of your javascript file:

/* globals jquery lodash someOtherLibrary */

However, Cloud9 doesn't do autocomplete for client side libraries yet.

Comments