AddAnyFile icon indicating copy to clipboard operation
AddAnyFile copied to clipboard

New template for .razor.cs files for Blazor

Open kidmar opened this issue 3 years ago • 2 comments

Could you add support for .razor.cs files? As an example if I add the Counter.razor.cs file (to separate code from the layout of a Blazor control), it generates this template:

public class Counter.razor
{
        
}

It should generate this instead:

public partial class Counter
{
        
}

Currently I don't think it is possible to add a template for this because the "double" extension does not get evaluated and it only "sees" the .cs extension.

kidmar avatar Jun 23 '22 10:06 kidmar

As the the intention here is to do a code-behind file to a .razor file. The structure can be as

public class CounterBase : ComponentBase {

}

ganeshalhat avatar Jul 02 '22 10:07 ganeshalhat

Would be awesome to generally support file names with two dots like "mypartialclass.somepart.cs" or ""mypartialclass.someotherpart.cs" to both result in

public partial class mypartialclass
{
}

UweKeim avatar Aug 12 '22 06:08 UweKeim