groovy-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Saravanan Palanichamy <chava...@gmail.com>
Subject Re: IDE support for multi assignment statements
Date Fri, 11 Dec 2020 14:40:02 GMT
Hi 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

https://www.jetbrains.com/help/idea/groovy.html

regards
Saravanan

On Fri, Dec 11, 2020 at 2:59 PM MG <mgbiz@arscreat.com> wrote:

> Hi Saravanan,
>
> 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()
> and
> 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 ;-)
>
> Cheers,
> mg
>
> *In all but the most obscure cases
>
>
> On 11/12/2020 06:54, Saravanan Palanichamy wrote:
> > Hello
> >
> > 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?
>
>

Mime
View raw message