groovy-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dogbert <>
Subject Re: Question about AST Transforms and @DelegatesTo
Date Mon, 05 Sep 2016 13:40:13 GMT
After thinking about my own question and looking at it, I don't think it is
possible, because of timing. Even if I could create a version of @DelegatesTo
that could be applied to the parameters of an AST Transform(which are
methods), the class that I would want to delegate to wouldn't be compiled
yet, and I don't think it could be because it's a Grails service.  If you
can confirm what I'm thinking, I'm misunderstanding something, or there is
another way around this, that you can think of,  let me know.


On Fri, Sep 2, 2016 at 8:41 AM, Dogbert <> wrote:

> So I have a question about AST Transforms and @DelegatesTo, as it would
> relate to AST transforms in a Grails plugin I wrote:
> I don't think I can use @DelegatesTo as is, but, if I could figure out how
> it works, could I write a new version of @DelegatesTo, that I could apply
> to the parameters of an AST transform like:
> main/groovy/com/virtualdogbert/ast/Enforce.groovy
> main/groovy/com/virtualdogbert/ast/EnforceASTTransformation.groovy
> So that I could convince an IDE like intellij that those closure
> parameters delegate to a service class, so that when I use methods from
> that service class or it's traits, the IDE wont mark them as unresolved.
> Thank you for reading, and any help or direction you might provide.
> -Tucker

View raw message