Some Groovy 2.0 issues

Hi, I'm using IntelliJ with Groovy 2.0, and I'm having some issues with it.

  • At the moment, renaming of variables is not working. For some reason, IntelliJ asks me to rename the getter/setter too, even though there isn't any, and answering with yes or no doesn't do anything

  • The dynamic properties window is missing

  • The underlines are gone, so I don't know anymore what is good code and what is potentially bad

  • Groovy files which had errors always keep the red curly lines under the filename. The code analysis is stuck at 99%, and looks like this (the right uppermost small icon in the editor window): "Performing code analys: Syntax: 99%. No errors or warnings found so far". But it never reaches 100%.


And as an addition: it would be nice to have a feature (eg ctrlshiftspace) to show only the 'real' methods on an object, instead of all methods. For example, when I define a variable as String, I still get methods like 'every()', 'any()', 'grep()', etc. Actually all methods defined in DefaultGroovyMethods.java. It would be nice to filter them out and switch between 'all' methods and methods on the String class (like, for example, with ctrlshiftspace or something)

20 comments
Comment actions Permalink

Hello, Erik.

Thank you for your issues, we'll look at all of them.
Seems, all of these bugs are pernicious consequences of our move to new API. I can answer only about third one. You can put underlining of untyped Groovy references again in "Colors & Fonts" page of IDEA Settings. "Smart completion" feature you named is also under development.

Ilya

0
Comment actions Permalink

Actually, there are even more issues, which currently make it quite hard to develop Grails applications with IntelliJ.

  • At the moment, when opening a Grails plugin, I get the message that Spring facets are not allowed in Grails applications. After it has been removed by IntelliJ, it's automatically detected and readded to the project. Also, new projects are created with a Spring facet.

  • When creating a new project, the domain, controller, views, conf, services directories are not marked as source folders. Because of this, it's e.g. not possible to use packages in domain classes (cannot resolve symbol 'packagename'. Also, the domain class dependencies overview is now broken, probably also because of the directory not being a source folder.

  • The integration and and unit directory are not detected as Test Source Folders.

  • The Grails navigation bar still doesn't work when you use packages, but works only for classes in de default/empty packages. For classes in the domain directory, the Grails navigation bar isn't even visible (for controllers, it is, but it doesn't work when using packages). As a consequence, it's not possible to generate grails controllers, which is annoying. (you can create them, but than they are empty. I want to generate them. Now I have to use a commandline for that)

  • Adding classes to the Dynamic properties from within a GSP page doesn't work. You can add it, and add it, and add it, but the type of a variable is never remembered.


Erik

Edited by: Erik Pragt on Aug 20, 2008 4:17 PM



Attachment(s):
Cannot Load Facets.jpg
0
Comment actions Permalink
  • Cannot assign null to java.lang.Object



Attachment(s):
cannot-assign-null.jpg
0
Comment actions Permalink

Erik,

Concerning your attached picture, it seems, that Grails facet is not properly configured (look at module settings), that's why groovy.lang.Closure class is not found in classpath and appropriate type of expression in rvalue cannot be inferred.

Ilya

0
Comment actions Permalink

Hi Ilya,

I'll check it, but what could be wrong with my configuration? I mean, everything else "works", like Grails Artifact generation, running my app as a Grails app (except for the above problems), etc...

Erik

0
Comment actions Permalink

Hi, any updates on this?

0
Comment actions Permalink

Hello, Erik.

As for your last question, I can only offer to check for groovy.lang.Closure class in your Grails SDK. As judged by your screenshot this class cannot be resolved by some cause. It might be corrupted SDK or wrong configuration. But as I inderstand, we exclude second variant.

Ilya

0
Comment actions Permalink

As for your other issues, we are in process of fixing them. But from those you describe only incorrect properties rename is not fixed yet.

Ilya

0
Comment actions Permalink

Great! Any idea when we can expect the new version? Since the broken navigation bar and not detecting the source files is a bit annoying at the moment!

0
Comment actions Permalink

Bundled JetGroovy plugin will be available in several hours with new Diana EAP.

0
Comment actions Permalink

Well, that's service! Thanks!

0
Comment actions Permalink

Ilya,

Am I correct that the JetGroovy plugin is no longer separately installable? I cannot find it in the list of plugins anymore, though I see it's bundled... (but the 'upgrade' button is greyed out...)

Erik

0
Comment actions Permalink

Btw, I just went through the plugin, to see if everything was fixed, and it seems like most issues are fixed! Well done!!

However, at the moment,

  • the Grails Toolbar still doesn't work when using packages. When not using packages, I at least have the option to generate some stuff, but who doesn't use packages? In other words, the toolbar still doesn't work correctly, except for the domain class dropdown, which seems to work without any problem (even with packages). I also get an error with the 'EventTests' button, which does say 'create tests', but when clicking on it, I get the error that I have to create my domain class first. I can imagine this has to do with the packages...

  • When having a domain class without packages, the Grails bar is gone after clicking on the tests. So the easy navigation is gone. Same for controllertests

  • When adding Event.list(params) to the list of dynamic properties, I specify that Event.list returns a List. However, when using code completion, I still get an 'Object' as return type, and when doing introduce variable it's also still an Object. The same for other methods, eg Event.count(), which is a static method which should return a long: according to my code completion, even after adding it to dynamic properties, it still returns an Object.

  • Renaming variables in domain classes still don't work (but you already knew that)


But:

  • I see the dynamic properties window again

  • I see the underlines again

  • I haven't seen a code analyses get stuck at 99%...

  • Source folders are again correctly identified!

  • Message about Spring facets in Grails application is removed!


So, while a lot of great things have improved, it would be great if (at least) the packages stuff could be fixed. I know Grails and packages do not really get along very well, but it would be great if IntelliJ would at least show how it should be done!

Thanks, Erik

0
Comment actions Permalink

Hello Erik,

Am I correct that the JetGroovy plugin is no longer separately
installable? I cannot find it in the list of plugins anymore, though I
see it's bundled... (but the 'upgrade' button is greyed out...)


That's correct. New builds of JetGroovy are available only as part of IDEA
EAP builds.

--
Dmitry Jemerov
Development Lead
JetBrains, Inc.
http://www.jetbrains.com/
"Develop with Pleasure!"


0
Comment actions Permalink

Ah, sorry, I was wrong: the folders are not correctly detected:

The test folder (unit and integration) still need to be manually added and are not detected as test source folders...

0
Comment actions Permalink

Oh, and IntelliJ also thinks now that the src folder contains sources... it does not: the src/java and src/groovy folder contain sources. Now my packages are called "groovy.net.mydomain.something".....

0
Comment actions Permalink

Code formating -- Groovy does not seem to be using the same tab settings (4 spaces) as are set for my Java files. It seems to be using 2 spaces when I tab.

Cutting a method to relocate it in the same source file results in the function definition being indented 2 spaces instead of 4.

Will Groovy get its own tab settings options under the Code Style, General panel as Java and XML get?

0
Comment actions Permalink

Erik,

We provided separate indent settings for Groovy and GSP in last Diana builds and in further release.

With best regards,
Ilya

0
Comment actions Permalink

I am using Diana 8995 that I just installed this morning (Nov 3rd).

Where are these setting specified?

0
Comment actions Permalink

Erik,

Look for "indent option" in IDEA's "code style settings". There will be speciall "Groovy" and "GSP" tabs there.

With best regards,
Ilya

0

Please sign in to leave a comment.