Skip to content

Commit

Permalink
Merge pull request #16 from Swarley97/feature/SupportSameClassNames
Browse files Browse the repository at this point in the history
unique hintname for generated source
  • Loading branch information
Swarley97 authored Oct 20, 2023
2 parents dcd4550 + 5d6789c commit e058cd3
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<LangVersion>10</LangVersion>
<Version>1.0.0</Version>
<Version>1.0.2</Version>
</PropertyGroup>

</Project>
2 changes: 1 addition & 1 deletion ConstructorGenerator/ConstructorGenerator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public void Initialize(IncrementalGeneratorInitializationContext context)

context.RegisterSourceOutput(generationResult, (sourceProductionContext, source) =>
{
sourceProductionContext.AddSource($"{source.Item1.Type.Name}_ConstructorGenerator.g.cs", source.Item2.Code);
sourceProductionContext.AddSource($"{source.Item1.Type.ContainingNamespace}.{source.Item1.Type.Name}_ConstructorGenerator.g.cs", source.Item2.Code);
});
}

Expand Down
2 changes: 1 addition & 1 deletion ConstructorGenerator/ConstructorGenerator.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<PackageTags>generator; c#; constructor</PackageTags>
<PackageProjectUrl>https://github.com/Swarley97/ConstructorGenerator</PackageProjectUrl>
<IsDevelopmentDependency>true</IsDevelopmentDependency>
<Version>1.0.1</Version>
<Version>1.0.2</Version>
<PackageReadmeFile>README.md</PackageReadmeFile>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<IncludeBuildOutput>false</IncludeBuildOutput>
Expand Down
1 change: 1 addition & 0 deletions Sandbox/Sandbox.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,5 @@
<ProjectReference Include="..\ConstructorGenerator\ConstructorGenerator.csproj" ReferenceOutputAssembly="False" OutputItemType="Analyzer" />
</ItemGroup>


</Project>
9 changes: 9 additions & 0 deletions Sandbox/Sub/OtherClass.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
using ConstructorGenerator.Attributes;

namespace Sandbox.Sub;

internal partial struct Triangle
{
[ConstructorDependency(IsOptional = true)]
private double A;
}

0 comments on commit e058cd3

Please sign in to comment.