Resharper File Template - Extract part of the current file name

I'm trying to create a "handler" file template so that when I enter a name of "GetBlogRequestHandler" the following will be generated:

public class GetBlogRequestHandler : IHandle<GetBlogRequest, GetBlogResponse> {


The problem is that given then following template

public class %VARIABLE%RequestHandler : IHandle<%VARIABLE%Request, %VARIABLE%Response> {


I want to be able to set the macro for

to be "Current file name without extension", but without the

Is this possible, or are there any workarounds ?
1 comment
Comment actions Permalink

There are no direct ways to accomplish this, however, you can create your own macro for live templates - one that can remove the "RequestHandler" part of the filename. For more info on writing a macro see here:


Please sign in to leave a comment.