Enabled Nullable reference types. Added a temporary fix for clonable NRT warnings.

This commit is contained in:
Kwoth
2021-12-28 10:40:59 +01:00
parent 89c2cda9ec
commit 0634470a8a
6 changed files with 320 additions and 6 deletions

View File

@@ -3,10 +3,8 @@ using System.CodeDom.Compiler;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.Text;
using Newtonsoft.Json;
namespace NadekoBot.Generators
@@ -20,7 +18,7 @@ namespace NadekoBot.Generators
[Generator]
public class LocalizedStringsGenerator : ISourceGenerator
{
private const string LocStrSource = @"namespace NadekoBot
private const string LOC_STR_SOURCE = @"namespace NadekoBot
{
public readonly struct LocStr
{
@@ -89,10 +87,10 @@ namespace NadekoBot.Generators
sw.Flush();
context.AddSource("strs.cs", stringWriter.ToString());
context.AddSource("strs.g.cs", stringWriter.ToString());
}
context.AddSource("LocStr.cs", LocStrSource);
context.AddSource("LocStr.g.cs", LOC_STR_SOURCE);
}
private List<TranslationPair> GetFields(string dataText)