-
The closest discussion I found is #31 but the answer doesn't mention or direct on how to do it, just states that it is indeed "possible". I haven't found any examples on how to actually do it or anything mentioning actual source generators at all. One use case would be writing simple structs like, marking it as an event, [Event]
public struct SomeEvent
{
} and getting an additional repetitive classes generated based on the struct type, fields and constructors public class SomeEventChannel : Channel<SomeEvent>
{
// Additional stuff based on methods and constructors from SomeEvent
}
// ...
public static class Channels
{
public static SomeEventChannel SomeEvent = new();
// More of the above based on anything marked as [Event]
} |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
It is not possible to add a new type with Metalama at the moment. |
Beta Was this translation helpful? Give feedback.
It is not possible to add a new type with Metalama at the moment.
It is possible to do that using Roslyn Source Generators, a technology from Microsoft.