Skip to content

Commit 061a8b0

Browse files
committed
Fix TrackAttribute not picking up tracked interfaces to register
1 parent 22fd675 commit 061a8b0

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

Medicine.SourceGenerator~/Generators/TrackingSourceGenerator.cs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ void IIncrementalGenerator.Initialize(IncrementalGeneratorInitializationContext
2020
fullyQualifiedMetadataName: attributeName,
2121
predicate: static (node, _) => node is ClassDeclarationSyntax,
2222
transform: (attributeSyntaxContext, ct)
23-
=> TransformSyntaxContext(attributeSyntaxContext, ct, attributeName, $"global::Medicine.{attributeName}")
23+
=> TransformSyntaxContext(attributeSyntaxContext, ct, attributeName, $"global::{attributeName}")
2424
)
2525
.Where(x => x.Attribute is { Length: > 0 })
2626
.Combine(medicineSettings)
@@ -201,7 +201,6 @@ void EmitRegistrationMethod(string methodName, params string?[] methodCalls)
201201
{
202202
src.Line.Write(Alias.Hidden);
203203
src.Line.Write(Alias.ObsoleteInternal);
204-
src.Line.Write($"{@protected}{@new}void {methodName}()");
205204
}
206205
else
207206
{
@@ -221,10 +220,10 @@ void EmitRegistrationMethod(string methodName, params string?[] methodCalls)
221220
src.Line.Write($"/// or <c>Awake</c>+<c>OnDestroy</c>. Make sure the registration methods are never stopped by an earlier exception.");
222221
src.Line.Write($"/// </remarks>");
223222
}
224-
225-
src.Line.Write($"{@protected}{@new}void {methodName}()");
226223
}
227224

225+
src.Line.Write($"{@protected}{@new}void {methodName}()");
226+
228227
using (src.Braces)
229228
{
230229
if (input.HasBaseDeclarationsWithAttribute)

0 commit comments

Comments
 (0)