Skip to content

Commit f543c54

Browse files
committed
support inheritance
1 parent 56f8c83 commit f543c54

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

src/TypedSignalR.Client.TypeScript/RoslynExtensions.cs

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,24 @@ public static IEnumerable<ISymbol> GetPublicFieldsAndProperties(this INamedTypeS
2828

2929
public static IEnumerable<IMethodSymbol> GetMethods(this INamedTypeSymbol source)
3030
{
31-
return source.GetMembers()
31+
var methods = source.GetMembers()
3232
.OfType<IMethodSymbol>()
3333
.Where(static x => x.MethodKind == MethodKind.Ordinary);
34+
35+
var allInterfaces = source.AllInterfaces;
36+
37+
if (allInterfaces.IsEmpty)
38+
{
39+
return methods;
40+
}
41+
42+
var allMethods = allInterfaces
43+
.SelectMany(static x => x.GetMembers())
44+
.OfType<IMethodSymbol>()
45+
.Where(static x => x.MethodKind is MethodKind.Ordinary)
46+
.Concat(methods);
47+
48+
return allMethods;
3449
}
3550

3651
public static IEnumerable<ISymbol> IgnoreStatic(this IEnumerable<ISymbol> source)

0 commit comments

Comments
 (0)