Skip to content

Commit

Permalink
如果不存在生成的代码则不加入
Browse files Browse the repository at this point in the history
  • Loading branch information
lindexi committed Nov 14, 2023
1 parent 7182805 commit 892d74e
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,10 @@ public void Initialize(IncrementalGeneratorInitializationContext context)
context.RegisterSourceOutput(generatedCodeProvider,
(sourceProductionContext, generatedCode) =>
{
sourceProductionContext.AddSource("__AttributedTypesExport__", generatedCode);
if(!string.IsNullOrEmpty(generatedCode))
{
sourceProductionContext.AddSource("__AttributedTypesExport__", generatedCode);
}
});
}

Expand Down

0 comments on commit 892d74e

Please sign in to comment.