Skip to content

Commit 44181f3

Browse files
committed
All code generators have a file name suffix.
1 parent a6d4a71 commit 44181f3

File tree

10 files changed

+107
-107
lines changed

10 files changed

+107
-107
lines changed

src/Thinktecture.Runtime.Extensions.SourceGenerator/CodeAnalysis/AdHocUnions/AdHocUnionCodeGenerator.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ namespace Thinktecture.CodeAnalysis.AdHocUnions;
55
public class AdHocUnionCodeGenerator : CodeGeneratorBase
66
{
77
public override string CodeGeneratorName => "AdHocUnion-CodeGenerator";
8-
public override string? FileNameSuffix => null;
8+
public override string FileNameSuffix => ".AdHocUnion";
99

1010
private readonly AdHocUnionSourceGenState _state;
1111
private readonly StringBuilder _sb;

src/Thinktecture.Runtime.Extensions.SourceGenerator/CodeAnalysis/CodeGeneratorBase.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@ public abstract class CodeGeneratorBase
66
#nullable enable";
77

88
public abstract string CodeGeneratorName { get; }
9-
public abstract string? FileNameSuffix { get; }
9+
public abstract string FileNameSuffix { get; }
1010
public abstract void Generate(CancellationToken cancellationToken);
1111
}

src/Thinktecture.Runtime.Extensions.SourceGenerator/CodeAnalysis/RegularUnions/RegularUnionCodeGenerator.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ private readonly record struct TypeMember(
99
string ArgumentName);
1010

1111
public override string CodeGeneratorName => "RegularUnion-CodeGenerator";
12-
public override string? FileNameSuffix => null;
12+
public override string FileNameSuffix => ".RegularUnion";
1313

1414
private readonly RegularUnionSourceGenState _state;
1515
private readonly StringBuilder _sb;

src/Thinktecture.Runtime.Extensions.SourceGenerator/CodeAnalysis/SmartEnums/SmartEnumCodeGenerator.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ public sealed class SmartEnumCodeGenerator : SmartEnumAndValueObjectCodeGenerato
99
private readonly StringBuilder _sb;
1010

1111
public override string CodeGeneratorName => "SmartEnum-CodeGenerator";
12-
public override string? FileNameSuffix => null;
12+
public override string FileNameSuffix => ".SmartEnum";
1313

1414
public SmartEnumCodeGenerator(SmartEnumSourceGeneratorState state, StringBuilder stringBuilder)
1515
{

src/Thinktecture.Runtime.Extensions.SourceGenerator/CodeAnalysis/ValueObjects/ComplexValueObjectCodeGenerator.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ public sealed class ComplexValueObjectCodeGenerator : SmartEnumAndValueObjectCod
1111
private readonly StringBuilder _sb;
1212

1313
public override string CodeGeneratorName => "ValueObject-CodeGenerator";
14-
public override string? FileNameSuffix => null;
14+
public override string FileNameSuffix => ".ComplexValueObject";
1515

1616
public ComplexValueObjectCodeGenerator(ComplexValueObjectSourceGeneratorState state, StringBuilder stringBuilder)
1717
{

src/Thinktecture.Runtime.Extensions.SourceGenerator/CodeAnalysis/ValueObjects/KeyedValueObjectCodeGenerator.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ public sealed class KeyedValueObjectCodeGenerator : SmartEnumAndValueObjectCodeG
1111
private readonly StringBuilder _sb;
1212

1313
public override string CodeGeneratorName => "ValueObject-CodeGenerator";
14-
public override string? FileNameSuffix => null;
14+
public override string FileNameSuffix => ".ValueObject";
1515

1616
public KeyedValueObjectCodeGenerator(KeyedValueObjectSourceGeneratorState state, StringBuilder stringBuilder)
1717
{

test/Thinktecture.Runtime.Extensions.SourceGenerator.Tests/SourceGeneratorTests/AdHocUnionSourceGeneratorTests.cs

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ public partial class TestUnion;
2525
""";
2626
var outputs = GetGeneratedOutputs<AdHocUnionSourceGenerator>(source, typeof(UnionAttribute<,>).Assembly);
2727

28-
await VerifyAsync(outputs, "Thinktecture.Tests.TestUnion.g.cs");
28+
await VerifyAsync(outputs, "Thinktecture.Tests.TestUnion.AdHocUnion.g.cs");
2929
}
3030

3131
[Fact]
@@ -42,7 +42,7 @@ public partial struct TestUnion;
4242
""";
4343
var outputs = GetGeneratedOutputs<AdHocUnionSourceGenerator>(source, typeof(UnionAttribute<,>).Assembly);
4444

45-
await VerifyAsync(outputs, "Thinktecture.Tests.TestUnion.g.cs");
45+
await VerifyAsync(outputs, "Thinktecture.Tests.TestUnion.AdHocUnion.g.cs");
4646
}
4747

4848
[Fact]
@@ -59,7 +59,7 @@ namespace Thinktecture.Tests
5959
""";
6060
var outputs = GetGeneratedOutputs<AdHocUnionSourceGenerator>(source, typeof(UnionAttribute<,>).Assembly);
6161

62-
await VerifyAsync(outputs, "Thinktecture.Tests.TestUnion.g.cs");
62+
await VerifyAsync(outputs, "Thinktecture.Tests.TestUnion.AdHocUnion.g.cs");
6363
}
6464

6565
[Fact]
@@ -76,7 +76,7 @@ public partial class TestUnion;
7676
""";
7777
var outputs = GetGeneratedOutputs<AdHocUnionSourceGenerator>(source, typeof(UnionAttribute<,>).Assembly);
7878

79-
await VerifyAsync(outputs, "Thinktecture.Tests.TestUnion.g.cs");
79+
await VerifyAsync(outputs, "Thinktecture.Tests.TestUnion.AdHocUnion.g.cs");
8080
}
8181

8282
[Fact]
@@ -93,7 +93,7 @@ public partial class TestUnion;
9393
""";
9494
var outputs = GetGeneratedOutputs<AdHocUnionSourceGenerator>(source, typeof(UnionAttribute<,>).Assembly);
9595

96-
await VerifyAsync(outputs, "Thinktecture.Tests.TestUnion.g.cs");
96+
await VerifyAsync(outputs, "Thinktecture.Tests.TestUnion.AdHocUnion.g.cs");
9797
}
9898

9999
[Fact]
@@ -110,7 +110,7 @@ public partial class TestUnion;
110110
""";
111111
var outputs = GetGeneratedOutputs<AdHocUnionSourceGenerator>(source, typeof(UnionAttribute<,>).Assembly);
112112

113-
await VerifyAsync(outputs, "Thinktecture.Tests.TestUnion.g.cs");
113+
await VerifyAsync(outputs, "Thinktecture.Tests.TestUnion.AdHocUnion.g.cs");
114114
}
115115

116116
[Fact]
@@ -127,7 +127,7 @@ public partial class TestUnion;
127127
""";
128128
var outputs = GetGeneratedOutputs<AdHocUnionSourceGenerator>(source, typeof(UnionAttribute<,>).Assembly);
129129

130-
await VerifyAsync(outputs, "Thinktecture.Tests.TestUnion.g.cs");
130+
await VerifyAsync(outputs, "Thinktecture.Tests.TestUnion.AdHocUnion.g.cs");
131131
}
132132

133133
[Fact]
@@ -144,7 +144,7 @@ public partial class TestUnion;
144144
""";
145145
var outputs = GetGeneratedOutputs<AdHocUnionSourceGenerator>(source, typeof(UnionAttribute<,>).Assembly);
146146

147-
await VerifyAsync(outputs, "Thinktecture.Tests.TestUnion.g.cs");
147+
await VerifyAsync(outputs, "Thinktecture.Tests.TestUnion.AdHocUnion.g.cs");
148148
}
149149

150150
[Fact]
@@ -161,7 +161,7 @@ public partial class TestUnion;
161161
""";
162162
var outputs = GetGeneratedOutputs<AdHocUnionSourceGenerator>(source, typeof(UnionAttribute<,>).Assembly);
163163

164-
await VerifyAsync(outputs, "Thinktecture.Tests.TestUnion.g.cs");
164+
await VerifyAsync(outputs, "Thinktecture.Tests.TestUnion.AdHocUnion.g.cs");
165165
}
166166

167167
[Fact]
@@ -178,7 +178,7 @@ public partial class TestUnion;
178178
""";
179179
var outputs = GetGeneratedOutputs<AdHocUnionSourceGenerator>(source, typeof(UnionAttribute<,>).Assembly);
180180

181-
await VerifyAsync(outputs, "Thinktecture.Tests.TestUnion.g.cs");
181+
await VerifyAsync(outputs, "Thinktecture.Tests.TestUnion.AdHocUnion.g.cs");
182182
}
183183

184184
[Fact]
@@ -195,7 +195,7 @@ public partial class TestUnion;
195195
""";
196196
var outputs = GetGeneratedOutputs<AdHocUnionSourceGenerator>(source, typeof(UnionAttribute<,>).Assembly);
197197

198-
await VerifyAsync(outputs, "Thinktecture.Tests.TestUnion.g.cs");
198+
await VerifyAsync(outputs, "Thinktecture.Tests.TestUnion.AdHocUnion.g.cs");
199199
}
200200

201201
[Fact]
@@ -212,7 +212,7 @@ public partial class TestUnion;
212212
""";
213213
var outputs = GetGeneratedOutputs<AdHocUnionSourceGenerator>(source, typeof(UnionAttribute<,>).Assembly);
214214

215-
await VerifyAsync(outputs, "Thinktecture.Tests.TestUnion.g.cs");
215+
await VerifyAsync(outputs, "Thinktecture.Tests.TestUnion.AdHocUnion.g.cs");
216216
}
217217

218218
[Fact]
@@ -229,7 +229,7 @@ public partial class TestUnion;
229229
""";
230230
var outputs = GetGeneratedOutputs<AdHocUnionSourceGenerator>(source, typeof(UnionAttribute<,>).Assembly);
231231

232-
await VerifyAsync(outputs, "Thinktecture.Tests.TestUnion.g.cs");
232+
await VerifyAsync(outputs, "Thinktecture.Tests.TestUnion.AdHocUnion.g.cs");
233233
}
234234

235235
[Fact]
@@ -246,7 +246,7 @@ public partial class TestUnion;
246246
""";
247247
var outputs = GetGeneratedOutputs<AdHocUnionSourceGenerator>(source, typeof(UnionAttribute<,>).Assembly);
248248

249-
await VerifyAsync(outputs, "Thinktecture.Tests.TestUnion.g.cs");
249+
await VerifyAsync(outputs, "Thinktecture.Tests.TestUnion.AdHocUnion.g.cs");
250250
}
251251

252252
[Fact]
@@ -263,7 +263,7 @@ public partial class TestUnion;
263263
""";
264264
var outputs = GetGeneratedOutputs<AdHocUnionSourceGenerator>(source, typeof(UnionAttribute<,>).Assembly);
265265

266-
await VerifyAsync(outputs, "Thinktecture.Tests.TestUnion.g.cs");
266+
await VerifyAsync(outputs, "Thinktecture.Tests.TestUnion.AdHocUnion.g.cs");
267267
}
268268

269269
[Fact]
@@ -280,7 +280,7 @@ public partial class TestUnion;
280280
""";
281281
var outputs = GetGeneratedOutputs<AdHocUnionSourceGenerator>(source, typeof(UnionAttribute<,>).Assembly);
282282

283-
await VerifyAsync(outputs, "Thinktecture.Tests.TestUnion.g.cs");
283+
await VerifyAsync(outputs, "Thinktecture.Tests.TestUnion.AdHocUnion.g.cs");
284284
}
285285

286286
[Fact]
@@ -297,7 +297,7 @@ public partial class TestUnion;
297297
""";
298298
var outputs = GetGeneratedOutputs<AdHocUnionSourceGenerator>(source, typeof(UnionAttribute<,>).Assembly);
299299

300-
await VerifyAsync(outputs, "Thinktecture.Tests.TestUnion.g.cs");
300+
await VerifyAsync(outputs, "Thinktecture.Tests.TestUnion.AdHocUnion.g.cs");
301301
}
302302

303303
[Fact]
@@ -314,7 +314,7 @@ public partial class TestUnion;
314314
""";
315315
var outputs = GetGeneratedOutputs<AdHocUnionSourceGenerator>(source, typeof(UnionAttribute<,>).Assembly);
316316

317-
await VerifyAsync(outputs, "Thinktecture.Tests.TestUnion.g.cs");
317+
await VerifyAsync(outputs, "Thinktecture.Tests.TestUnion.AdHocUnion.g.cs");
318318
}
319319

320320
[Fact]
@@ -333,7 +333,7 @@ public partial class TestUnion;
333333
""";
334334
var outputs = GetGeneratedOutputs<AdHocUnionSourceGenerator>(source, typeof(UnionAttribute<,>).Assembly);
335335

336-
await VerifyAsync(outputs, "Thinktecture.Tests.TestUnion.g.cs");
336+
await VerifyAsync(outputs, "Thinktecture.Tests.TestUnion.AdHocUnion.g.cs");
337337
}
338338

339339
[Fact]
@@ -351,7 +351,7 @@ public partial class TestUnion;
351351
""";
352352
var outputs = GetGeneratedOutputs<AdHocUnionSourceGenerator>(source, typeof(UnionAttribute<,>).Assembly);
353353

354-
await VerifyAsync(outputs, "Thinktecture.Tests.TestUnion.g.cs");
354+
await VerifyAsync(outputs, "Thinktecture.Tests.TestUnion.AdHocUnion.g.cs");
355355
}
356356

357357
[Fact]
@@ -371,7 +371,7 @@ public partial class _1TestUnionWithSpecialChars;
371371
""";
372372
var outputs = GetGeneratedOutputs<AdHocUnionSourceGenerator>(source, typeof(UnionAttribute<,>).Assembly);
373373

374-
await VerifyAsync(outputs, "Thinktecture.Tests._1TestUnionWithSpecialChars.g.cs");
374+
await VerifyAsync(outputs, "Thinktecture.Tests._1TestUnionWithSpecialChars.AdHocUnion.g.cs");
375375
}
376376

377377
[Fact]
@@ -389,6 +389,6 @@ public partial class TestUnion;
389389
""";
390390
var outputs = GetGeneratedOutputs<AdHocUnionSourceGenerator>(source, typeof(UnionAttribute<,>).Assembly);
391391

392-
await VerifyAsync(outputs, "Thinktecture.Tests.TestUnion.g.cs");
392+
await VerifyAsync(outputs, "Thinktecture.Tests.TestUnion.AdHocUnion.g.cs");
393393
}
394394
}

0 commit comments

Comments
 (0)