views:

126

answers:

1

I use a modified form of TODO comment (SteveC_TODO) that allows me to group my own todos together in the task list.

Yesterday I thought it would be nice to modify the refactoring snippets to add a todo comment to the usual NotImplemented exception. I modified the Method Stub - Body snippet to this

$signature$
{
  //SteveC_TODO: implement $end$$signature$
  throw new $Exception$();
}

but this results in the todo comment having the full method signature. It serves the purpose but I would prefer the comment to only use the name from the method signature and be of the form

//SteveC_TODO: implement CoolMethod

rather than of the form

//SteveC_TODO: implement private void CoolMethod(object o)

Does anyone know of a way that I can do this? I presume that the arguments passed to refactoring snippets are fixed but perhaps there is a way to parse the $signature$ argument to extract just the name. Anyone know if that might be possible?

+1  A: 

I think you have to modify it to something like

$accessability$ $returntype$ $method$($arguments$) 
{
   //SteveC_TODO: implement $method$
   $end$throw new $Exception$("The method or operation is not implemented.");
}

You have to declare the literals accessability, returntype, method, arguments,...

Have a look here for how to create codesnippets

Peter
As I expected that doesn't work. The refactoring code that calls the snippet expects it to have a $signature$ token.
Steve Crane