Skip to content

Commit 6066800

Browse files
committed
Fix missing namespace
1 parent 7d39905 commit 6066800

6 files changed

+25
-9
lines changed

Shiny.Extensions.Localization.Generator.Tests/LocalizationSourceGeneratorTests.EndToEndTest_rootNamespace=MyTest_projectName=MyTest.Core_generateInternal=False#ServiceCollectionExtensions.g.verified.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
11
//HintName: ServiceCollectionExtensions.g.cs
2+
// <auto-generated />
3+
// This file is auto-generated by Shiny.Extensions.Localization.Generator
4+
// Do not edit this file directly, instead edit the .resx files in your project.
5+
using global::Microsoft.Extensions.DependencyInjection;
6+
27
namespace MyTest;
38

49
public static class ServiceCollectionExtensions_Generated

Shiny.Extensions.Localization.Generator.Tests/LocalizationSourceGeneratorTests.EndToEndTest_rootNamespace=null_projectName=MyTest.Library_generateInternal=False#ServiceCollectionExtensions.g.verified.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
11
//HintName: ServiceCollectionExtensions.g.cs
2+
// <auto-generated />
3+
// This file is auto-generated by Shiny.Extensions.Localization.Generator
4+
// Do not edit this file directly, instead edit the .resx files in your project.
5+
using global::Microsoft.Extensions.DependencyInjection;
6+
27
namespace MyTest.Library;
38

49
public static class ServiceCollectionExtensions_Generated

Shiny.Extensions.Localization.Generator.Tests/LocalizationSourceGeneratorTests.EndToEndTest_rootNamespace=null_projectName=MyTest.Library_generateInternal=True#ServiceCollectionExtensions.g.verified.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
11
//HintName: ServiceCollectionExtensions.g.cs
2+
// <auto-generated />
3+
// This file is auto-generated by Shiny.Extensions.Localization.Generator
4+
// Do not edit this file directly, instead edit the .resx files in your project.
5+
using global::Microsoft.Extensions.DependencyInjection;
6+
27
namespace MyTest.Library;
38

49
internal static class ServiceCollectionExtensions_Generated

Shiny.Extensions.Localization.Generator.Tests/LocalizationSourceGeneratorTests.EndToEndTest_rootNamespace=null_projectName=MyTest_generateInternal=False#ServiceCollectionExtensions.g.verified.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
11
//HintName: ServiceCollectionExtensions.g.cs
2+
// <auto-generated />
3+
// This file is auto-generated by Shiny.Extensions.Localization.Generator
4+
// Do not edit this file directly, instead edit the .resx files in your project.
5+
using global::Microsoft.Extensions.DependencyInjection;
6+
27
namespace MyTest;
38

49
public static class ServiceCollectionExtensions_Generated

Shiny.Extensions.Localization.Generator.Tests/LocalizationSourceGeneratorTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public async Task EndToEndTest(string? rootNamespace, string projectName, bool g
3434
resource1.AddString("MyNamespace.MyEnum.MyEnumValue", "This is an enum value");
3535

3636
GeneratorDriver driver = CSharpGeneratorDriver.Create(
37-
new[] { generator },
37+
[generator],
3838
optionsProvider: options,
3939
additionalTexts: ImmutableArray.Create<AdditionalText>(resource1)
4040
);

Shiny.Extensions.Localization.Generator/LocalizationSourceGenerator.cs

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -129,20 +129,16 @@ bool useInternalAccessor
129129
}
130130

131131

132-
static string SafePropertyKey(string keyName)
133-
{
134-
return keyName
135-
.Replace(".", "_")
136-
.Replace("-", "_")
137-
.Replace(" ", "_");
138-
}
132+
static string SafePropertyKey(string keyName) => keyName
133+
.Replace(".", "_")
134+
.Replace("-", "_")
135+
.Replace(" ", "_");
139136

140137

141138
static string GenerateServiceCollectionRegistration(string rootNamespace, IEnumerable<string> generatedTypes, bool useInternalAccessor)
142139
{
143140
var accessor = useInternalAccessor ? "internal" : "public";
144141
var sb = new StringBuilder()
145-
146142
.AppendLine("// <auto-generated />")
147143
.AppendLine("// This file is auto-generated by Shiny.Extensions.Localization.Generator")
148144
.AppendLine("// Do not edit this file directly, instead edit the .resx files in your project.")

0 commit comments

Comments
 (0)