src/Features/Core/Portable/InheritanceMargin/AbstractInheritanceMarginService_Helpers.cs
/// <summary>
/// Get the derived interfaces and derived classes for <param name="typeSymbol"/>.
/// </summary>
Get the derived interfaces and derived classes for .
Get the derived interfaces and derived classes for .
private static async Task<ImmutableArray<INamedTypeSymbol>> GetDerivedTypesAndImplementationsAsync(
            Solution solution,
            INamedTypeSymbol typeSymbol,
            CancellationToken cancellationToken)
        {
            if (typeSymbol.IsInterfaceType())
            {
                var allDerivedInterfaces = await SymbolFinder.FindDerivedInterfacesArrayAsync(
                    typeSymbol,
                    solution,
                    transitive: true,
                    cancellationToken: cancellationToken).ConfigureAwait(false);
                var allImplementations = await SymbolFinder.FindImplementationsArrayAsync(
                    typeSymbol,
                    solution,
                    transitive: true,
                    cancellationToken: cancellationToken).ConfigureAwait(false);
                return allDerivedInterfaces.Concat(allImplementations);
            }
            else
            {
                return await SymbolFinder.FindDerivedClassesArrayAsync(
                    typeSymbol,
                    solution,
                    transitive: true,
                    cancellationToken: cancellationToken).ConfigureAwait(false);
            }
        }
private static async Task < ImmutableArray < INamedTypeSymbol > > GetDerivedTypesAndImplementationsAsync ( Solution solution , INamedTypeSymbol typeSymbol , CancellationToken cancellationToken ) { if ( typeSymbol . IsInterfaceType ( ) ) { var allDerivedInterfaces = await SymbolFinder . FindDerivedInterfacesArrayAsync ( typeSymbol , solution , transitive : true , cancellationToken : cancellationToken ) . ConfigureAwait ( false ) ; var allImplementations = await SymbolFinder . FindImplementationsArrayAsync ( typeSymbol , solution , transitive : true , cancellationToken : cancellationToken ) . ConfigureAwait ( false ) ; return allDerivedInterfaces . Concat ( allImplementations ) ; } else { return await SymbolFinder . FindDerivedClassesArrayAsync ( typeSymbol , solution , transitive : true , cancellationToken : cancellationToken ) . ConfigureAwait ( false ) ; } }
Get the derived interfaces and derived classes for .
Get the derived interfaces and derived classes for .
solution
Solution
typeSymbol
INamedTypeSymbol
cancellationToken
CancellationToken