madskristensen / AddAnyFile

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

Can we add sealed classes by default? #123

Closed voroninp closed 1 year ago

voroninp commented 2 years ago

Hi, your cool extension is very nice, but is it possible to configure it, so it creates sealed classes?

nf313743 commented 1 year ago

You can achieve this using templates:

Create a .templates folder at the root of your project. The templates inside this folder will be used alongside the default ones.

Create a .cs.txt file in .templates similar to this: https://github.com/madskristensen/AddAnyFile/blob/master/src/Templates/.cs.txt

voroninp commented 1 year ago

Thanks. Is it also possible to extend the set? For example, if file is named BlaBlaTests.cs then template for xunit test is used.

voroninp commented 1 year ago

Nevermind, found answer here