Skip to content

Commit cb13d19

Browse files
committed
fix: corrects generator handlers identification
1 parent 8c405b0 commit cb13d19

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

Concordia.Generator/ConcordiaGenerator.cs

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -88,13 +88,7 @@ public void Initialize(IncrementalGeneratorInitializationContext context)
8888
/// <returns>The bool</returns>
8989
private static bool IsHandlerCandidate(SyntaxNode node)
9090
{
91-
return node is ClassDeclarationSyntax classDeclaration &&
92-
classDeclaration.BaseList != null &&
93-
classDeclaration.BaseList.Types.Any(baseType =>
94-
baseType.Type is GenericNameSyntax genericName &&
95-
(genericName.Identifier.Text.Contains("RequestHandler") ||
96-
genericName.Identifier.Text.Contains("NotificationHandler") ||
97-
genericName.Identifier.Text.Contains("PipelineBehavior")));
91+
return node is ClassDeclarationSyntax { BaseList: not null };
9892
}
9993

10094
// Retrieves handler information from a syntax context.
@@ -115,6 +109,11 @@ baseType.Type is GenericNameSyntax genericName &&
115109
return null;
116110
}
117111

112+
if (classSymbol.IsAbstract)
113+
{
114+
return null;
115+
}
116+
118117
var implementedInterfaces = new List<string>();
119118

120119
// Iterates through all implemented interfaces.

0 commit comments

Comments
 (0)