Информация об изменениях

Сообщение Introducing C# Source Generators от 01.05.2020 12:06

Изменено 26.08.2020 9:03 Serginio1

Introducing C# Source Generators
https://devblogs.microsoft.com/dotnet/introducing-c-source-generators/
Как то новость прошла без энтузиазма

Очень интересен пример AutoNotifyGenerator https://github.com/dotnet/roslyn-sdk/blob/master/samples/CSharp/SourceGenerators/SourceGeneratorSamples/AutoNotifyGenerator.cs
Пример использования атрибутов
https://github.com/dotnet/roslyn-sdk/blob/master/samples/CSharp/SourceGenerators/GeneratedDemo/UseAutoNotifyGenerator.cs
Раньше использовались Fody Refit которые Il код редактировали.
Ну и T4, правда бы еще и синтаксис типа разора

Так же собираются добавить partial методы отличных от void, ref параметры, private
https://github.com/jaredpar/csharplang/blob/partial/proposals/extending-partial-methods.md

partial on all members
Given that we're expanding partial to be more friendly to source generators should we also expand it to work on all class members? For example should we be able to declare partial constructors, operators, etc ...
Resolution The idea is sound but at this point in the C# 9 schedule we're trying to avoid unnecessary feature creep. Want to solve the immediate problem of expanding the feature to work with modern source generators.
Extending partial to support other members will be considered for the C# 10 release. Seems likely that we will consider this extension.

Introducing C# Source Generators
https://devblogs.microsoft.com/dotnet/introducing-c-source-generators/
Как то новость прошла без энтузиазма

Очень интересен пример AutoNotifyGenerator https://github.com/dotnet/roslyn-sdk/blob/master/samples/CSharp/SourceGenerators/SourceGeneratorSamples/AutoNotifyGenerator.cs
Пример использования атрибутов
https://github.com/dotnet/roslyn-sdk/blob/master/samples/CSharp/SourceGenerators/GeneratedDemo/UseAutoNotifyGenerator.cs
Раньше использовались Fody Refit которые Il код редактировали.
Ну и T4, правда бы еще и синтаксис типа разора

Так же собираются добавить partial методы отличных от void, ref параметры, private
https://github.com/jaredpar/csharplang/blob/partial/proposals/extending-partial-methods.md

partial on all members
Given that we're expanding partial to be more friendly to source generators should we also expand it to work on all class members? For example should we be able to declare partial constructors, operators, etc ...
Resolution The idea is sound but at this point in the C# 9 schedule we're trying to avoid unnecessary feature creep. Want to solve the immediate problem of expanding the feature to work with modern source generators.
Extending partial to support other members will be considered for the C# 10 release. Seems likely that we will consider this extension.



Еще
New C# Source Generator Samples