4

Given I have a InterfaceDeclarationSyntax and the SemanticModel, is it possible for me to retrieve get all types that inherit the interface defined in InterfaceDeclarationSyntax? For example given interface IFoo I want to find things like class Foo: IFoo and interface IBar: IFoo, etc.

I've seen a SO question about how to find all implementations of an interface but they are not doing it programmatically, instead using ReSharper or tools in VS.

I'm trying to find a method that would match my needs through VS's intellisense and roslyn docs but not finding what I need. Hoping someone can shed some light.

0

1 Answer 1

7

Call SymbolFinder.FindImplementationsAsync(interfaceSymbol, solution).

Source

Sign up to request clarification or add additional context in comments.

1 Comment

prime example of why linking external sources is a terrible idea

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.