new variable "method_name" for Code Generator? [message #154868] |
Sat, 17 April 2004 22:45  |
Eclipse User |
|
|
|
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
Hi all, I have a suggestion / feature request for
Eclipse, and wanted to run it by the community here
and see what the reaction was. Or possibly find out
that there is already a way to accomplish what I'm
trying to do.
Specifically, I would like to suggest adding a variable
called method_name to the list of variables available
for code generation templates, which would resolve to
the name of the method being created. The purpose of
this would be to allow templates such as this:
${todo} Auto-generated method stuf
throw new RuntimeException( "${method_name} not implemented yet" );
Personally I prefer for stubbed up methods to throw such
an exception, as opposed to just returning null. However,
unless I'm missing something, there currently is no easy
way for me to auto generate such a stub implementation.
Comments / feedback / flames welcome... or, if it turns
out that there IS a way to do this already, and I'm
just ignorant of it, I'd appreciate any suggestions on
how to do so.
Thanks,
Phillip Rhodes
|
|
|
Re: new variable "method_name" for Code Generator? [message #155243 is a reply to message #154868] |
Tue, 20 April 2004 15:49   |
Eclipse User |
|
|
|
Originally posted by: mrBob.yahoo.com
I think ${enclosing_method} is what you are looking for.
/J
"Phillip Rhodes" <mindcrime@cpphacker.co.uk> wrote in message
news:c5spih$arb$1@eclipse.org...
> Content-Type: text/plain; charset=us-ascii; format=flowed
> Content-Transfer-Encoding: 7bit
>
> Hi all, I have a suggestion / feature request for
> Eclipse, and wanted to run it by the community here
> and see what the reaction was. Or possibly find out
> that there is already a way to accomplish what I'm
> trying to do.
>
> Specifically, I would like to suggest adding a variable
> called method_name to the list of variables available
> for code generation templates, which would resolve to
> the name of the method being created. The purpose of
> this would be to allow templates such as this:
>
> ${todo} Auto-generated method stuf
> throw new RuntimeException( "${method_name} not implemented yet" );
>
> Personally I prefer for stubbed up methods to throw such
> an exception, as opposed to just returning null. However,
> unless I'm missing something, there currently is no easy
> way for me to auto generate such a stub implementation.
>
> Comments / feedback / flames welcome... or, if it turns
> out that there IS a way to do this already, and I'm
> just ignorant of it, I'd appreciate any suggestions on
> how to do so.
>
> Thanks,
>
> Phillip Rhodes
>
|
|
|
Re: new variable "method_name" for Code Generator? [message #155290 is a reply to message #155243] |
Tue, 20 April 2004 23:11  |
Eclipse User |
|
|
|
Mr Bob Dobolina wrote:
> I think ${enclosing_method} is what you are looking for.
>
D'oh!!!! I don't know how the heck I overlooked that,
but you're absolutely right... that's exactly what
I was looking for...
Although... it would be nice to have a variable that
expands to the full signature (minus return type)
of the method. So if I use Eclipse's code generator
to implement a bunch of stubs for an interface,
and there are overloaded versions, my "not implemented yet"
message would show me exactly which overload isn't
implemented yet.
TTYL,
Phil
|
|
|
Powered by
FUDForum. Page generated in 0.05187 seconds