Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

unique hintname for generated source #16

Merged
merged 2 commits into from
Oct 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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;
}
Loading