Skip to content

Commit 13dfbb2

Browse files
committed
Change local variable name
1 parent 9836cff commit 13dfbb2

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

Flow.Launcher.Localization.SourceGenerators/Localize/EnumSourceGenerator.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ private void Execute(SourceProductionContext spc,
6969
var pluginClasses = data.Item1.Item1.PluginClassInfos;
7070
var enumsDeclarations = data.Item1.Item1.EnumsDeclarations;
7171

72-
var assemblyName = compilation.AssemblyName ?? Constants.DefaultNamespace;
72+
var assemblyNamespace = compilation.AssemblyName ?? Constants.DefaultNamespace;
7373
var useDI = configOptions.GetFLLUseDependencyInjection();
7474

7575
var pluginInfo = PluginInfoHelper.GetValidPluginInfoAndReportDiagnostic(pluginClasses, spc, useDI);
@@ -85,7 +85,7 @@ private void Execute(SourceProductionContext spc,
8585
if (enumSymbol?.GetAttributes().Any(ad =>
8686
ad.AttributeClass?.Name == Constants.EnumLocalizeAttributeName) ?? false)
8787
{
88-
GenerateSource(spc, enumSymbol, useDI, pluginInfo, assemblyName);
88+
GenerateSource(spc, enumSymbol, useDI, pluginInfo, assemblyNamespace);
8989
}
9090
}
9191
}
@@ -156,7 +156,7 @@ private void GenerateSource(
156156
INamedTypeSymbol enumSymbol,
157157
bool useDI,
158158
PluginClassInfo pluginInfo,
159-
string assemblyName)
159+
string assemblyNamespace)
160160
{
161161
var enumFullName = enumSymbol.ToDisplayString(SymbolDisplayFormat.FullyQualifiedFormat);
162162
var enumDataClassName = $"{enumSymbol.Name}{Constants.EnumLocalizeClassSuffix}";
@@ -222,7 +222,7 @@ private void GenerateSource(
222222
}
223223
else if (pluginInfo?.IsValid == true)
224224
{
225-
getTranslation = $"{pluginInfo.ContextAccessor}.API.GetTranslation";
225+
getTranslation = $"{assemblyNamespace}.{pluginInfo.ContextAccessor}.API.GetTranslation";
226226
}
227227

228228
// Generate GetValues method
@@ -249,7 +249,7 @@ private void GenerateSource(
249249
sourceBuilder.AppendLine($"}}");
250250

251251
// Add source to context
252-
spc.AddSource($"{Constants.ClassName}.{assemblyName}.{enumNamespace}.{enumDataClassName}.g.cs", SourceText.From(sourceBuilder.ToString(), Encoding.UTF8));
252+
spc.AddSource($"{Constants.ClassName}.{assemblyNamespace}.{enumNamespace}.{enumDataClassName}.g.cs", SourceText.From(sourceBuilder.ToString(), Encoding.UTF8));
253253
}
254254

255255
private static void GeneratedHeaderFromPath(StringBuilder sb, string enumFullName)

Flow.Launcher.Localization.SourceGenerators/Localize/LocalizeSourceGenerator.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ private void Execute(SourceProductionContext spc,
9797
var usedKeys = data.Item1.Item1.Item1.Item1.InvocationKeys;
9898
var localizedStrings = data.Item1.Item1.Item1.Item1.LocalizableStrings;
9999

100-
var assemblyName = compilation.AssemblyName ?? Constants.DefaultNamespace;
100+
var assemblyNamespace = compilation.AssemblyName ?? Constants.DefaultNamespace;
101101
var useDI = configOptions.GetFLLUseDependencyInjection();
102102

103103
var pluginInfo = PluginInfoHelper.GetValidPluginInfoAndReportDiagnostic(pluginClasses, spc, useDI);
@@ -108,7 +108,7 @@ private void Execute(SourceProductionContext spc,
108108
spc,
109109
xamlFiles[0],
110110
localizedStrings,
111-
assemblyName,
111+
assemblyNamespace,
112112
useDI,
113113
pluginInfo,
114114
usedKeys);
@@ -429,7 +429,7 @@ private static void GenerateSource(
429429
SourceProductionContext spc,
430430
AdditionalText xamlFile,
431431
ImmutableArray<LocalizableString> localizedStrings,
432-
string assemblyName,
432+
string assemblyNamespace,
433433
bool useDI,
434434
PluginClassInfo pluginInfo,
435435
IEnumerable<string> usedKeys)
@@ -458,7 +458,7 @@ private static void GenerateSource(
458458
sourceBuilder.AppendLine();
459459

460460
// Generate namespace
461-
sourceBuilder.AppendLine($"namespace {assemblyName};");
461+
sourceBuilder.AppendLine($"namespace {assemblyNamespace};");
462462
sourceBuilder.AppendLine();
463463

464464
// Uncomment them for debugging
@@ -518,7 +518,7 @@ private static void GenerateSource(
518518
sourceBuilder.AppendLine("}");
519519

520520
// Add source to context
521-
spc.AddSource($"{Constants.ClassName}.{assemblyName}.g.cs", SourceText.From(sourceBuilder.ToString(), Encoding.UTF8));
521+
spc.AddSource($"{Constants.ClassName}.{assemblyNamespace}.g.cs", SourceText.From(sourceBuilder.ToString(), Encoding.UTF8));
522522
}
523523

524524
private static void GeneratedHeaderFromPath(StringBuilder sb, string xamlFilePath)

0 commit comments

Comments
 (0)