views:

74

answers:

1

hello, i downloaded sts and installed the grails/groovy plugins which is good, but i can not use the javascript functionality like jumping trought classes and functions in the javascript editor. when i click command and on the functions name, than i get a dialog saying "you have to make this a javascript project etc." :( :( intellij is much better at this i think but it takes all my cpu usage which is really sad :( so i need to switch to eclipse... so the actual question is: y can i not use the javascript editor plugin from eclipse while a project is a "grails project" ?

+2  A: 

Eclipse's JavaScript editor is part of the Eclipse Web Tools Project (WTP). Thus, it's shipped with SpringSource Tools Suite (STS).

In new STS Grails projects as created by the Grails project creation wizard, however, the JavaScript project facet is not enabled by default.

To enable it,

  • right-click on the project root in the Project View,
  • select Properties,
  • in the Properties dialog, select Project Facets,
  • click Convert to faceted form...,
  • mark the JavaScript checkbox,
  • and click OK.

After that,

  • there will be a new top-level item JavaScript Resources (where you can browse the sources of ECMA and third-party JavaScript files),
  • and there'll be code inspection and completion in HTML <script> tags
  • and JavaScript source files (file extension: .js),
  • including for third-party libraries.
robbbert
@robbbert has the eclipse JS editor still lack things like refactoring, code coloring, good js error detection, etc?
hvgotcodes
@hvgotcodes, I'm not regularly working with it; so I cannot really tell. - Basic refactoring affects HTML files that reference refactored JavaScript files but does not affect Grails GSP files. Code coloring exists. Error detection will be quite limited due to JavaScripts dynamic nature. - Additionally, there are ApiDoc tooltips, and also basic navigation ("go to source", etc.) between JavaScript source files. - The plugin apparently has made some progress over the last years.
robbbert
@robbbert i ask because ive been using intellij (paying for it) for its js support, which is MUCH better than eclipses. Or at least it was last year...
hvgotcodes
@hvgotcodes, I just had a brief look at IDEA's (community edition) JavaScript capabilities, evaluating all features mentioned above. - Undoubtedly, Eclipse's JavaScript support excels IDEA's by a magnitude, at least. - Nevertheless, now let's focus on the original question again. Thanks
robbbert