Skip to content

Commit b95bfc5

Browse files
committed
修复生成的类不全的问题
1 parent 3acc40e commit b95bfc5

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

src/dotnetCampus.LatestCSharpFeatures.Analyzer/FeatureGenerator.cs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,16 @@ public void Initialize(IncrementalGeneratorInitializationContext context)
1919

2020
private void OnExecute(SourceProductionContext context, AnalyzerConfigOptionsProvider provider)
2121
{
22-
GenerateFeatureSource(context, provider, "IsExternalInit");
22+
// .NET Core 1.0 / .NET Framework 4.7 / .NET Standard 2.0 才开始支持 ValueTuple。
23+
GenerateFeatureSource(context, provider, "ValueTuple");
24+
25+
// .NET Core 3.0 / .NET Standard 2.1 才开始支持 Nullable;.NET 5.0 开始支持更多。
2326
GenerateFeatureSource(context, provider, "Nullable");
27+
28+
// .NET 5.0 才开始支持 ExternalInit
29+
GenerateFeatureSource(context, provider, "ExternalInit");
30+
31+
// .NET 7.0 才开始支持 SetsRequiredMembersAttribute
2432
GenerateFeatureSource(context, provider, "Required");
2533
}
2634

0 commit comments

Comments
 (0)