zompinc / sync-method-generator

Generates a synchronized version of an async method
MIT License
48 stars 4 forks source link

long name for autogenerated file #32

Open lsoft opened 10 months ago

lsoft commented 10 months ago

In process of switching my big old enterprice system from sync model to sync+async model with this ISG, I noticed that the ISG can produce a very long cs name if cs's namespace is long itself.

I did not face with problems but I suspect the problems can arise if g.cs filename + emit compiler generated folder will be longer than 260 symbols.

To see the potential issue put the following inside of csproj witch consumes ISG:

    <EmitCompilerGeneratedFiles>true</EmitCompilerGeneratedFiles>
    <CompilerGeneratedFilesOutputPath>$(BaseIntermediateOutputPath)Generated</CompilerGeneratedFilesOutputPath>

May be the better behaviour is to truncate the name of g.cs file if it is too long.

just fyi, I may be wrong.

virzak commented 10 months ago

Yeah, good scenario to test.