Since the hint name to context.AddSource must be unique within the context, there seems to be some trickery behind the scenes to define a unique name for each source code generated, but that doesn't work if SourceGeneratorHelpers.GenerateCode() is called multiple times with specifications that have the same type name, but the namespace differ.
The flat structure generated is also quite difficult to navigate, as many types will be called the same thing, i.e. Foo1.g.cs, Foo2.g.cs, Foo3.g.cs etc.
Would be great if it was possible to direct the hint name, or let the fully qualified type declaration name dictate the structure as is common in C#, i.e. Bar.Foo -> Bar/Foo.g.cs.
Since the hint name to
context.AddSourcemust be unique within the context, there seems to be some trickery behind the scenes to define a unique name for each source code generated, but that doesn't work ifSourceGeneratorHelpers.GenerateCode()is called multiple times with specifications that have the same type name, but the namespace differ.The flat structure generated is also quite difficult to navigate, as many types will be called the same thing, i.e. Foo1.g.cs, Foo2.g.cs, Foo3.g.cs etc.
Would be great if it was possible to direct the hint name, or let the fully qualified type declaration name dictate the structure as is common in C#, i.e.
Bar.Foo->Bar/Foo.g.cs.