Add MeansImplicitUse attribute to patch and injectable attributes (#591)

This commit is contained in:
Chomp
2025-09-18 09:34:27 +00:00
committed by GitHub
4 changed files with 14 additions and 2 deletions
@@ -1,6 +1,9 @@
namespace SPTarkov.DI.Annotations;
using JetBrains.Annotations;
namespace SPTarkov.DI.Annotations;
[AttributeUsage(AttributeTargets.Class, Inherited = false)]
[MeansImplicitUse]
public class Injectable(InjectionType injectionType = InjectionType.Scoped, Type? typeOverride = null, int typePriority = int.MaxValue)
: Attribute
{
+1
View File
@@ -15,6 +15,7 @@
<GenerateDocumentationFile>true</GenerateDocumentationFile>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="JetBrains.Annotations" Version="2025.2.2" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="9.0.9" />
</ItemGroup>
<ItemGroup>
@@ -1,18 +1,25 @@
namespace SPTarkov.Reflection.Patching;
using JetBrains.Annotations;
namespace SPTarkov.Reflection.Patching;
[AttributeUsage(AttributeTargets.Method)]
[MeansImplicitUse]
public class PatchPrefixAttribute : Attribute { }
[AttributeUsage(AttributeTargets.Method)]
[MeansImplicitUse]
public class PatchPostfixAttribute : Attribute { }
[AttributeUsage(AttributeTargets.Method)]
[MeansImplicitUse]
public class PatchTranspilerAttribute : Attribute { }
[AttributeUsage(AttributeTargets.Method)]
[MeansImplicitUse]
public class PatchFinalizerAttribute : Attribute { }
[AttributeUsage(AttributeTargets.Method)]
[MeansImplicitUse]
public class PatchIlManipulatorAttribute : Attribute { }
/// <summary>
@@ -18,6 +18,7 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="HarmonyX" Version="2.15.0" />
<PackageReference Include="JetBrains.Annotations" Version="2025.2.2" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\SPTarkov.DI\SPTarkov.DI.csproj" />