2

Using the GetMembers() method of INamedTypeSymbol seems to return only types explicitly declared in that class. How can I get a list of all the methods, including the inherited ones?

If this requires walking the chain of base classes, calling GetMembers() on each one, how can I determine which method is the "most derived" one, so to speak?

DeCaf
  • 6,026
  • 1
  • 29
  • 51
  • Take a look at [this](http://stackoverflow.com/questions/15711500/c-sharp-reflection-get-info-for-all-members-of-class-and-base-classes) and possible duplicate question. – Raj Karri Jun 29 '15 at 18:39
  • @rajasekhara I don't see how that's a duplicate, since it uses reflection, and not Roslyn, and also it's searching for a member of a particular name? – DeCaf Jun 29 '15 at 18:52

1 Answers1

0

If you want this based on a particular location (so that things like accessibility are incorporated, then SemanticModel.LookupSymbols is what you need. If you want something else, then it isn't something the compiler deals with, so you'll have to put it together yourself using GetMembers()

Kevin Pilch
  • 11,485
  • 1
  • 39
  • 41