Skip to content

Commit 111c989

Browse files
authored
Merge pull request #4 from Flow-Launcher/mark-generated-code
Mark generated code as generated to avoid analyzers working on it
2 parents 0995c9b + 0c6d3dd commit 111c989

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -304,9 +304,11 @@ private void GenerateClass(
304304
Dictionary<string, LocalizableString> localizedStrings,
305305
string[] unusedLocalizationKeys,
306306
string propertyName = null
307-
)
308-
{
307+
) {
308+
const string name = nameof(LocalizeSourceGenerator);
309+
var version = typeof(LocalizeSourceGenerator).Assembly.GetName().Version;
309310
sb.AppendLine();
311+
sb.AppendLine($"[System.CodeDom.Compiler.GeneratedCode(\"{name}\", \"{version}\")]");
310312
sb.AppendLine($"public static class {ClassName}");
311313
sb.AppendLine("{");
312314
foreach (var localizedString in localizedStrings)

0 commit comments

Comments
 (0)