dslds always adding parens for inferred method calls?

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

dslds always adding parens for inferred method calls?

steve.ash
I have created a dsld for files ending with the extension "script".  I have added script as an extension in the content assist.  My dsld uses a delegateTo and everything is working perfectly.  On a blank line in the editor for a .script file I am prompted for the public methods on the class which is the target of the delegateTo in the dsld.  However, when I choose an option and hit enter, it is auto-completed but _with_ parenthesis around the argument.  I have the preferences -> groovy -> do not use parens option checked in the preferences, but it still puts them in.  

Is this a known issue or am I missing some other setting somewhere?

Thanks!

Steve Ash
Reply | Threaded
Open this post in threaded view
|

Re: dslds always adding parens for inferred method calls?

Andrew Eisenberg
Try using the "noParens" argument for a method in your dsld, like this:

contribute(currentType(String)) {
  method name: "yay", noParens:true, params: [first:String]
}

This will add a method called yay to all strings, with a single string argument. Parens will not be used.  I think this is what you are after.



On Fri, Sep 6, 2013 at 4:53 PM, Steve Ash <[hidden email]> wrote:
I have created a dsld for files ending with the extension "script".  I have added script as an extension in the content assist.  My dsld uses a delegateTo and everything is working perfectly.  On a blank line in the editor for a .script file I am prompted for the public methods on the class which is the target of the delegateTo in the dsld.  However, when I choose an option and hit enter, it is auto-completed but _with_ parenthesis around the argument.  I have the preferences -> groovy -> do not use parens option checked in the preferences, but it still puts them in.  

Is this a known issue or am I missing some other setting somewhere?

Thanks!

Steve Ash