using System.Collections.Immutable; using System.Linq; using Microsoft.CodeAnalysis; namespace ComputeSharp.SourceGenerators; /// partial class IShaderGenerator { /// /// A helper with all logic to generate the GetDispatchId method. /// private static partial class GetDispatchId { /// /// Extracts the names of all instance fields of a type. /// /// The input instance to process. /// The names of all instance fields within . public static ImmutableArray GetInfo(INamedTypeSymbol structDeclarationSymbol) { return structDeclarationSymbol .GetMembers() .OfType() .Where(static member => member is { Type: INamedTypeSymbol { TypeKind: TypeKind.Delegate, IsStatic: false }, IsImplicitlyDeclared: false }) .Select(static member => member.Name) .ToImmutableArray(); } } }