Skip to content

Commit c517941

Browse files
committed
[Proto] Prevent emit when no type declarations are present
1 parent a50837b commit c517941

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

Lagrange.Proto.Generator/ProtoSourceGenerator.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,9 @@ public void Initialize(IncrementalGeneratorInitializationContext context)
2727
private static void Emit(SourceProductionContext context, Parser parser)
2828
{
2929
foreach (var diagnostic in parser.Diagnostics) context.ReportDiagnostic(diagnostic);
30-
30+
31+
if (parser.TypeDeclarations.Count == 0) return;
32+
3133
var emitter = new Emitter(parser);
3234
emitter.Emit(context);
3335
}

0 commit comments

Comments
 (0)