score:288

Accepted answer

complete the following steps in eclipse to get plugins for javascript files:

  1. open eclipse -> go to "help" -> "install new software"
  2. select the repository for your version of eclipse. i have juno so i selected http://download.eclipse.org/releases/juno
  3. expand "programming languages" -> check the box next to "javascript development tools"
  4. click "next" -> "next" -> accept the terms of the license agreement -> "finish"
  5. wait for the software to install, then restart eclipse (by clicking "yes" button at pop up window)
  6. once eclipse has restarted, open "window" -> "preferences" -> expand "general" and "editors" -> click "file associations" -> add ".js" to the "file types:" list, if it is not already there
  7. in the same "file associations" dialog, click "add" in the "associated editors:" section
  8. select "internal editors" radio at the top
  9. select "javascript viewer". click "ok" -> "ok"

to add javascript perspective: (optional)
10. go to "window" -> "open perspective" -> "other..."
11. select "javascript". click "ok"

to open .html or .js file with highlighted javascript syntax:
12. (optional) select javascript perspective
13. browse and select .html or .js file in script explorer in [javascript perspective] (or package explorer [java perspective] or pydev package explorer [pydev perspective] don't matter.)
14. right-click on .html or .js file -> "open with" -> "other..."
15. select "internal editors"
16. select "java script editor". click "ok" (see javascript syntax is now highlighted )

score:2

in 2015 i would go with:

  • for small scripts: the js editor + jshint plugin
  • for large code bases: typescript eclipse plugin, or a similar transpiled language... i only know that typescript works well in eclipse.

of course you may want to keep js for easy project setup and to avoid the transpilation process... there is no ultimate solution.

or just wait for ecma6, 7, ... :)

score:5

think that javascriptdevelopmenttools might do it. although, i have eclipse indigo, and i'm pretty sure it does that kind of thing automatically.

score:5

javascript that allows for syntax checking

jshint-eclipse

and autosuggestions for .js files in eclipse?

  1. use jsdoc more as jsdt has nice support for the standard, so you will get more suggestions for your own code.
  2. there is new ternide that provide additional hints for .js and angulatjs .html. get them together as anide from http://www.nodeclipse.org/updates/anide/

as nodeclipse lead, i am always looking for what is available in eclipse ecosystem. nodeclipse site has even more links, and i am inviting to collaborate on the javascript tools on github


Related Query

More Query from same tag