You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
"Editor > Typing > Automatically insert at correct position > Braces" conflicts with typing constructors with single Closure or SAM-type parameter #1108
If the option "Automatically insert at correct position" | "Braces" in Java | Editor | Typing is checked and you try to write a constructor call with a closure as its last parameter, the opening brace is pushed outside the round parenthesis, so that the final result is the creation of an anonymous inner class instead of a constructor call.
#1093 fixed the issue for the g1 case in the above example, by considering the presence of the "comma" the discriminator to avoid such a behaviour.
However in the g2 case the problem persists.
I think the common case here is to call the constructor, while creating an anonymous inner class is a much less common case. Especially in Groovy, especially in Java 8+ days.
It's more natural to me to move the cursor after the round closing parenthesis and then opening the brace whenever I really want to create an inner class, rather than letting the editor decide for me that I do not want to call the constructor, but rather to create an anonymous inner class, and hence moving away the cursor from the point where I really wanted to insert my brace...