-
Notifications
You must be signed in to change notification settings - Fork 28
Description
Hello!
@MilleBo I just wanted to thank you again for this awesome library! It is probably my favorite tool I have ever worked with. Before, I used Handlebars.Net which allowed me to build very quickly, however, it was not flexible at all. Now I am working with Testura.Code and love it! It took some time for me to get started, due to the many options which you provide (It's a good thing!).
I wanted to ask you a few questions:
A.) Roadmap Questions:
Personally, i very much dislike the 'Primary Constructor syntax' which Microsoft has introduced.
Primary Constructor Pattern for records:
public readonly record struct DailyTemperature(double HighTemp, double LowTemp);^^^ In my opinion, it (Primary Constructor Pattern) is strange, and does not conform to the rest of the C# formatting patterns.
I believe records should only be formatted like:
My preferred way:
public record SomeRandomName
{
public string FirstName { get; }
public string LastName { get; }
public string FullName => $"{this.FirstName} {this.LastName}";
}- Any plans to allow File-scoped namespaces?
Originally I disliked file-scoped namespaces, now I have grown to love them. It helps force cleaner code. I think file scoped namespaces are a step in the correct direction, now only if Microsoft forced one class or record per file <3.
- What do you have planned next? A Roadmap? or a 'To-Do list?
I understand this is not your full-time job <3, I just wanted to know that if I were to submit pull-requests, what is high-priority, and what is low-priority?
B.) Code Questions:
- Where in Testura.Code can I find the compilation code for 'Class' or 'Enum'? I would like to work on added
Record Typesif this is something you would like to add.
C.) Code I have developed for Testura.Code:
I have built some tools that help me work with Testura.Code easier and quicker, if you think these features are useful, i can share the code with you and you can review it closely to see if its helpful for Testura.Code. My thoughts are that Testura.Code is pure, so you want to be careful with introducing code that is 'extra'. The choice is yours!
- I have built fluent interfaces for most of the library:
var built = SmartTesturaClassBuilder.Initialize()
.WithClassName(className)
.WithoutInheritance()
.WithDestinationFile(fileDestination)
.AsPublic()
.WithUsingStatements("SomeNamespace")
.WithAttributes(oneType)
.WithSummary("SomeSummary")
.WithoutProperties()
.Build();I have more examples, but this gives you the idea
- I have built an enhanced 'Custom Type Creator'. So that you can easily create types like this:
SmartEnum<MyEnumClass, int>
ICollection<MyCustomClass>
ICollection<MyOtherClass, MyThirdClass>It is a small improvement on your class 'TypeGenerator'
I find that this is helpful for my use-case. For example, I am writing a code generator that 'reads' files, and then generates code. The issue is that I do not always have access to the .dll, so it makes reflection oriented generation difficult.
- I have a small program which scans the 'nuget cache' on the local computer then automatically inserts the correct using statements and namespace location of the file so that the developer does not need to think about this.
Currently, I compile everything as a 'string', then I do my extra work such as file-scoped namespaces, record types, and using statement injection, then I save it as a code file.
Your code is awesome and very easy to work with!!! Let me know if i can help or submit pull requests!
My coding pattern is not quite the same as your's, I also use some other libraries which I created (Like Common methods, etc) that I will need to remove, etc... If your interested I can show you the code and we can have a chat about what you would like and think about things.
I am at your service!
Thanks!