Last updated by admin 5 years ago

IDE Integration Wish list

Below are the features that would be great to have from a Grails IDE:

  • Wizards to create Grails artifacts like controllers/domain objects and so on. Unlike Rails, Grails doesn't do any background configuration with its command line tools so these can merely be simple wizards. NOTE: this may be true now but not in the future, I do not think (evil) wizards are a good idea. All you need is a class name anyway! We have new event script mechanisms that allow plugins to hook into scripting events and perform actions themselves, wizards would break this
  • Running a Grails server embedded in the IDE and being able to step debug the application. Groovy provides all the information in the classes necessary to enable step debugging of Groovy code
  • Code navigation with keyboard shotcuts and CTRL+click between Grails artifacts like controllers domain classes etc.
  • Code completion for things like dynamic finders and persistent methods like save/delete/findAll/findBy* on domain classes
  • Auto-completion of Grails tags in GSPs
  • Integration of an embedded Grails console to be able to execute arbitrary scripts against a running application
  • Being able to right-click execute Grails unit tests and get green/red bars etc.
  • Being able to right-click on a Grails project and execute all unit tests
  • Being able to right-click on a domain class and click generate to generate a controller and views for CRUD
  • Better editor support for groovy files. This means autocompletion and so on.
  • Special outline views for Domain-Classes, Controllers and Views
  • Graphical editor for Domain Classes, with a UML-like or ER-like view
  • The IDE should hook into Grails' upcoming plug-in architecture to be able to do things like auto-find new executable scripts, download and install new plug-ins etc.
  • Integration of every Servlet-Container to test the Grails-App. The best solution were intergration into webtools
  • XP Refactor support (e.g. rename methods/groovy file names and cascade changes to all dependencies)

Implementation suggestion

I think we should look at adding a single interface (static class) that provides most of the mechanisms an IDE plugin will need to manipulate Grails without having to directly spawn targets etc - to hide the implementation details. i.e:

final class GrailsIntegration {
   static void runApp(String baseDir) { … }
   static void runTests(String baseDir) { … }
   // for any others
   static void runTarget(String baseDir, String target, Object[] args) { … } 
   static void stop() { … }

// Create artefact and return names of files modified static String[] createArtefact(String typeName, Object[] args) { … }

static GrailsApplication getGrailsApplication() { … } static MetaClass[] getAllMetaClasses() { … } }