JetGroovy 1.5 Obvservations
Hi,
Having recreated my module after JetGroovy 1.5 eradicated it in favor of an entirely new one, I'm back to working. Already I've noticed some things about which I'd like to give some feedback:
- Navigation Bar
-- This is nice, but it takes up more space than I'd like it to. I'd like to see it shrunk (borders could easily be reduced), possibly relocated outside the text editing area (e.g., to the button bar) or made optional or movable to the bottom of the text editing area.
-- It would be nice to integate TagLibs into the selector. While they aren't technically part of the tuple <Domain, DomainController, DomainView, DomainTest, DomainControllerTest>, when their name fits the pattern, they could be included in the tuple.
-- Likewise, it would be nice if Services were accessible there.
- Inspections
-- Definite assignment check ("Variable 'something' might not be assigned") is sometimes incorrectly raised.
-- "Cannot apply default constructor for class 'DomainClass'": The Grails data-binding constructor for domain classes should be known by this inspection.
- Iconography / Graphics
-- The asterisk in the editor tab overlaps the padlock icon.
-- The extra border within the text area of Domain classes that accommodates the tabs at the bottom (to select Text or "domain class dependencies") causes the JetGroovy Navigation Bar and its contents to reposition slightly (but very noticeably). It's border should adjust to the difference so its contents do not appear to shift around when one moves between Domain and non-Domain classes.
- General
-- As JetGroovy gets more complex, I think it is going to be necessary to give users control over its features. E.g.: Colors (comments are colored differently, now); Navigation bar characteristics, etc.
- Irony
-- The access level check found a missing "public" keyword in years-old Java code.
Randall Schulz
Please sign in to leave a comment.
Hello Randall,
This is IDEA core feature that has been available since 6.0. If you don't like it, you can always hide it, though I personally find this functionality occasionally useful.
It;s not about the tuple, it's about one-to-one relation. I don't think taglib associate with these.
Same concern.
Is it in try/catch? Then this is because of due to the lack of checked exceptions we model control flow with two edges: one before the first try block instruction, and one after the last. Indeed since any statement in groovy may throw any exception, I don't see any other approximation that would be strict.
Yep, we have a request for integrating more domain classes PSI to jetgroovy. Though I personally don't like the approach to have a compiler inject additional methods/fields to domain classes...
Thanks for pointing this out, we'll try to avoid this.
Colors are configurable in coors and fonts, groovy tab. Navigation bar is again not a part of jetgroovy. As well as code coverage that works with groovy files:)
Sorry, we dont check for the age of your code in our inspections:)
Eugene.
Hi, Eugene,
Thanks for the details.
Regarding the Navigation Bar. Are we talking about the same thing? I'm talking about the bar that appears only when editing Groovy or GSP files that are part of a Grails application. I see it nowhere else and have never seen anything like it before.
I know the TagLibs are not one-to-one with any other file, but then again, neither are the Views. The point is that for the common cases (for me, anyway) when the TagLib is named for a particular Domain Class, it could be grouped with the rest of the files specific to that Domain Class.
The spurious "might not be assigned" diagnostic refers to local variables that are assigned at the outer-most level of the method (not closure) and are most definitely assigned. What's more, there are two such initializations immediately adjacent to each other, only one get the diagnostic. Reordering the initializations doesn't change which get the diagnostic and they're both used in very similar ways (they're arrays of String and the diagnostic occurs twice, both times is in a (for String str : strArray)):
There are a few try / finally pairs between the initialization and the use with the diagnostic. Here's the full listing:
The "Groovy" tab in the Colors & Fonts section of the IDE Settings had escaped my attention. Is it new in JetGroovy 1.5?
I shall refrain from entering a debate about Grails' philosophy and dynamic languages in general. But I (and JetBrains!) picked Groovy / Grails, and now I (we) have to work with it...
RRS
>> - Navigation Bar
>> -- This is nice, but it takes up more space than I'd like it to. I'd like to see it shrunk
>> (borders could easily be reduced), possibly relocated outside the text editing area
>> (e.g., to the button bar) or made optional or movable to the bottom of the text editing area.
I used the wrong terminology. I did not mean the Navigation Bar that appears below the Toolbar, but rather the navigational controls that are specific to files that are part of Grails applications.
RRS
OK, I see. We had it in 1.0, but you probably did not see it if your domain classes et al. are not in the default package. In 1.5 I made it work in that case as well.
Actually, all my Groovy / Grails packages are and have always been in the default package (probably not a good idea, I agree).
The appearance of the Grails navigational controls (what do you call them?) coincided with the eradication of my old module in favor of a newly created Grails one. (I'm not going to let you forget that your code had this very onerous effect!)
So my observations about this Grails navigational panel (whatever it's called) remain, and I hope you'll address them.
Randall Schulz
Hi Randall,
Ufff, fixing those control flow bugs (the ones that resulted in "Might not be assigned") has been really tough, but these were indeed quite serious. Thank you!
Editor decorator (as we call it after Alex Tkachman) shrinked its vertical borders. Thank you!
Editor decorator (as we call it after Alex Tkachman) shrinked its vertical borders. Thank you!
Thank you!
RRS