Support for varargs inside DSLD method defintion call

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Support for varargs inside DSLD method defintion call

btiernay
Is it possible to do something like the following when defining a method?

method name: 'tags', type: 'void', params: [values: 'String...'], doc: 'Defines metadata tags'

This doesn't seem to work. Not sure if there is a configuration point for this.

Thanks
Reply | Threaded
Open this post in threaded view
|

Re: Support for varargs inside DSLD method defintion call

Andrew Eisenberg
No.  The closest thing that you can do is specify params: [
'java.lang.String[]'].  This should work.  I actually don't think I
have tested it yet.

Feel free to raise a jira for this.

On Mon, Jan 2, 2012 at 7:57 AM, btiernay <[hidden email]> wrote:

> Is it possible to do something like the following when defining a method?
>
>
>
> This doesn't seem to work. Not sure if there is a configuration point for
> this.
>
> Thanks
>
> --
> View this message in context: http://groovy-eclipse-plugin.42567.n3.nabble.com/Support-for-varargs-inside-DSLD-method-defintion-call-tp3626883p3626883.html
> Sent from the groovy-eclipse-plugin-user mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
>    http://xircles.codehaus.org/manage_email
>
>

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|

Re: Support for varargs inside DSLD method defintion call

btiernay
I tried what you suggested but it doesn't seem to work. It just declares the type as def in the javadoc and Object in content assist. Should I raise a jira?

Thanks again,

Bob
Reply | Threaded
Open this post in threaded view
|

Re: Support for varargs inside DSLD method defintion call

btiernay
In reply to this post by Andrew Eisenberg
Okay, I was actually able to get what I intended by using the following:

params: ['values...': String]

I'm not sure if this was intended, but it works. Might want to add this to http://groovy.codehaus.org/DSL+Descriptors+for+Groovy-Eclipse for others benefit.

Thanks
Reply | Threaded
Open this post in threaded view
|

Re: Support for varargs inside DSLD method defintion call

Andrew Eisenberg
That's interesting!  I had no idea that was possible.  :-) it is
definitely something worth documenting (and adding to our test suite).

See http://jira.codehaus.org/browse/GRECLIPSE-1310

On Mon, Jan 2, 2012 at 10:18 AM, btiernay <[hidden email]> wrote:

> Okay, I was actually able to get what I intended by using the following:
>
> params: ['values...': String]
>
> I'm not sure if this was intended, but it works. Might want to add this to
> http://groovy.codehaus.org/DSL+Descriptors+for+Groovy-Eclipse for others
> benefit.
>
> Thanks
>
> --
> View this message in context: http://groovy-eclipse-plugin.42567.n3.nabble.com/Support-for-varargs-inside-DSLD-method-defintion-call-tp3626883p3627227.html
> Sent from the groovy-eclipse-plugin-user mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
>    http://xircles.codehaus.org/manage_email
>
>

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email