madskristensen / AddAnyFile

A Visual Studio extension
Apache License 2.0
262 stars 121 forks source link

New template for .razor.cs files for Blazor #126

Open kidmar opened 2 years ago

kidmar commented 2 years ago

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.

ganeshalhat commented 2 years ago

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 {

}

UweKeim commented 2 years ago

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
{
}