I am using Groovy 3.0.5 and it supports multiple assignment statements from tuples when using static compile
def(var1, var2) = Tuple.tuple("a", 1)
but it looks like the Intellij IDE still calls this out as a compile error. Also it defaults to identifying var1 and var2 as objects. This hinders code completion in subsequent code. Is this an issue for anyone else? or do I just have to upgrade my IDE?
what IntelliJ version are you using ? We are not using multiple
assignments in our code, but from my personal experience, IntelliJ can
unfortunately sometimes be more than 2 years behind current Groovy
features. If the newest IntelliJ version does not support what you need,
opening a ticket did help in the past (see e.g.
https://youtrack.jetbrains.com/issue/IDEA-193168), but you have to be
prepared to wait some time before seeing improvements.
In addition to that, IntelliJ sometimes marks valid Groovy code as
invalid, but reconsiders if one comments out the "offending" line(s),
and then comments it in again (I assume doing this triggers a new
Intellisense parser pass).
Interestingly afaik (disclaimer: I have not checked this recently, and
we are still on Groovy 2.5.x), Groovy will treat e.g.
var x = new Foo()
final x = new Foo()
as x having type Object - it is just IntelliJ Intellisense that deduces
x to be of type Foo*, thereby enabling auto completion, etc on x ;-)
*In all but the most obscure cases
On 11/12/2020 06:54, Saravanan Palanichamy wrote:
> I am using Groovy 3.0.5 and it supports multiple assignment statements from tuples when using static compile
> def(var1, var2) = Tuple.tuple("a", 1)
> but it looks like the Intellij IDE still calls this out as a compile error. Also it defaults to identifying var1 and var2 as objects. This hinders code completion in subsequent code. Is this an issue for anyone else? or do I just have to upgrade my IDE?
Am Freitag, den 11.12.2020, 10:29 +0100 schrieb MG:
Really? I have a RubyMine ticket open for more than 2 years now with nothing happening...
Senior Systems Engineer, Delivery Pipeline
OpenText ™ Discovery | Recommind
Phone: +49 2226 15966 18
Email: [hidden email]
Recommind GmbH, Von-Liebig-Straße 1, 53359 Rheinbach
Vertretungsberechtigte Geschäftsführer Gordon Davies, Madhu Ranganathan, Christian Waida, Registergericht Amtsgericht Bonn, Registernummer HRB 10646
This e-mail may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error) please notify the sender immediately and destroy this e-mail. Any unauthorized copying, disclosure or distribution of the material in this e-mail is strictly forbidden
Diese E-Mail enthält vertrauliche und/oder rechtlich geschützte Informationen. Wenn Sie nicht der richtige Adressat sind oder diese E-Mail irrtümlich erhalten haben, informieren Sie bitte sofort den Absender und vernichten Sie diese Mail. Das unerlaubte Kopieren sowie die unbefugte Weitergabe dieser Mail sind nicht gestattet.
signature.asc (235 bytes) Download Attachment
In reply to this post by MG
I am using Intellij IntelliJ IDEA 2020.2.3 (Community Edition)
Build #IC-202.7660.26, built on October 6, 2020
I have attached the error as a picture. The intellij web page says 3.0 is supported. I am not sure what to make of it though. The code runs cleanly and as expected
Error.png (276K) Download Attachment
In reply to this post by Dirk Heinrichs
I don't know about RubyMine, but for IntelliJ Groovy support, uhm, yea, obviously, as you can see in the umbrella ticket I referenced: I created several tickets, asked people to upvote them if they cared about the issue, and over (an alas elongated period of) time things did get fixed G-)
On 11/12/2020 10:41, Dirk Heinrichs wrote:
In reply to this post by Saravanan Palanichamy
You could try the newest version (2020.3), but if that does not help, I would guess JetBrains might possibly not even be aware that Groovy 3.x supports that feature. In that case creating a ticket is imho your best option (there are people from Jetbrains reading this ML, but they need a ticket to work on the issue*) - I would recommend posting the ticket URL here, so people can upvote - I sure will G-)
*I would also recommend closely following the ticket guidelines, i.e. describe current (erronous) state, and the expected behavior - in short you want to make it easy for them to work on this.
On 11/12/2020 15:40, Saravanan Palanichamy wrote:
Thank you MG, I raised this ticket
On Fri, Dec 11, 2020 at 8:59 PM MG <[hidden email]> wrote:
(I have thought about this, and in certain situations being able to have (Intellisense supported) multi-assignment would be beneficial in our framework, so it would definitely be good to have this)
On 11/12/2020 23:47, Saravanan Palanichamy wrote:
|Free forum by Nabble||Edit this page|