Skip to content

Commit 6a683d8

Browse files
authored
Merge pull request #41 from Flow-Launcher/auto_generate_variables
Fix issue that strings with parameters are not parsed automatically
2 parents d022ba5 + 7fdb0ac commit 6a683d8

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

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

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ public partial class LocalizeSourceGenerator : IIncrementalGenerator
2424
private static readonly Version PackageVersion = typeof(LocalizeSourceGenerator).Assembly.GetName().Version;
2525

2626
private static readonly ImmutableArray<LocalizableString> _emptyLocalizableStrings = ImmutableArray<LocalizableString>.Empty;
27-
private static readonly ImmutableArray<LocalizableStringParam> _emptyLocalizableStringParams = ImmutableArray<LocalizableStringParam>.Empty;
2827

2928
#endregion
3029

@@ -355,7 +354,8 @@ private static (string Summary, ImmutableArray<LocalizableStringParam> Parameter
355354
{
356355
if (comment == null || comment.Value == null || parameters.Count == 0)
357356
{
358-
return (null, _emptyLocalizableStringParams);
357+
// If the comment is not a valid XML, the summary is null and the parameters are not updated
358+
return (null, parameters.ToImmutableArray());
359359
}
360360

361361
try
@@ -385,7 +385,8 @@ private static (string Summary, ImmutableArray<LocalizableStringParam> Parameter
385385
}
386386
catch
387387
{
388-
return (null, _emptyLocalizableStringParams);
388+
// If the comment is not a valid XML, the summary is null and the parameters are not updated
389+
return (null, parameters.ToImmutableArray());
389390
}
390391
}
391392

0 commit comments

Comments
 (0)