xaviersolau / GeneratorTools

Code generator tools that helps you to automate C# code generation.
MIT License
9 stars 4 forks source link

Crash with large enums #67

Open Omnicrash opened 1 week ago

Omnicrash commented 1 week ago

I'm currently using the localization generator, and it seems to crash the generator tools when a very large enum exists in the project.

I've attached the enum that causes the issue (renamed to log so GitHub allows it).

The error message: Unhandled exception: System.ArgumentNullException: Value cannot be null. (Parameter 'source') at System.Linq.ThrowHelper.ThrowArgumentNullException(ExceptionArgument argument) at System.Linq.Enumerable.Any[TSource](IEnumerable1 source, Func2 predicate) at SoloX.GeneratorTools.Core.CSharp.Generator.Selectors.AttributeSelector1.<>c.b__0_1(IDeclaration1 d) at System.Linq.Enumerable.WhereSelectEnumerableIterator2.MoveNext() at System.String.Join(String separator, IEnumerable1 values) at SoloX.GeneratorTools.Core.CSharp.Generator.Impl.AutomatedGenerator.Generate(IEnumerable1 files) at Tools.LocalizationGen.Implementations.LocalizationGenerator.Generate(ICSharpWorkspace workspace, ILocator locator, IWriter fileWriter, ILocator jsonLocator, IReader jsonReader, IWriter jsonWriter, IEnumerable1 files, GeneratorOptions generatorOptions)

Country.cs.log

xaviersolau commented 1 week ago

Thanks for the bug report, I'm going to have a look.

xaviersolau commented 1 week ago

What version of the tool do you use? Is it the simple fact the enum is in you project or do you use the enum?