1

Why does the organize imports function in the Groovy Eclipse plug-in put imports above the package declaration and make the file uncompileable? Is there a work-around?

Joshua Goldberg
  • 5,059
  • 2
  • 34
  • 39
  • 1
    This question points to some other issues with groovy's organize imports: http://stackoverflow.com/questions/1408657/groovy-eclipse-plugin-organize-imports – Joshua Goldberg Mar 07 '12 at 19:10

1 Answers1

1

The current version of the plug-in gets confused when there are imbalanced parentheses. The editor itself also becomes less helpful for finding and fixing that kind of error. The solution I found was to open the file in another programming editor (such as emacs) to find the unbalanced pair.

Joshua Goldberg
  • 5,059
  • 2
  • 34
  • 39
  • As you have found out, organize imports requires a parsable file. If the file is not parsable, then organize imports should be disabled. In the past, we sometimes had trouble determining when there were unrecoverable syntax errors in the file. With the 2.6.0 release, we have gotten much better with this. Please make sure you are running a recent version of Groovy-Eclipse (2.6.1 was released a few days ago). If this still doesn't work, then raise a jira issue and show us the broken syntax. https://jira.codehaus.org/browse/GRECLIPSE – Andrew Eisenberg Mar 08 '12 at 05:26