10

Is there any way how I can see all classes inherited from a base class or an interface in Visual Studio Code? I know how to find all references, but this is not exactly what I'm looking for.

NOTE: This question relates to Visual Studio Code, not regular Visual Studio.

Alexey Andrushkevich
  • 5,992
  • 2
  • 34
  • 49
  • 1
    No, I do not think it is possible. – pwas Oct 12 '16 at 10:57
  • If it is particularly for your solution, try generating the class diagram. – The Shooter Oct 12 '16 at 10:58
  • Unfortunately I don't think there is any other way than Find All References – Monir Tarabishi Oct 12 '16 at 10:59
  • find all... search for the class or interface across the entire solution... thats what i do... there is a very useful pay for add-on called resharper which can do this. – Seabizkit Oct 12 '16 at 11:00
  • Right click the class name: Inspect - > Hierarchies CTRL E,H – Netferret Oct 12 '16 at 11:19
  • An approach is to search the code for the inheritance notation, something like `extends BaseClass` or `implements BaseInterface`. Many languages (i.e. Typescript) support implementation of several interfaces in a class, so you would have to search for something like `implements.*BaseInterface` using the regular expression search mode. More other an interface may extend several interfaces. In this case we would need to search for `extends.*BaseInterface`. – LuCio Jul 04 '19 at 06:24
  • Related C++ issue: https://github.com/microsoft/vscode-cpptools/issues/3799 – Ciro Santilli OurBigBook.com Sep 23 '19 at 14:13
  • Not sure for what language do you need it, but I found this proposal for Python: https://github.com/microsoft/vscode-python/issues/18559 (if you need it, please upvote it) – LuissRicardo Jun 29 '22 at 03:06

1 Answers1

3

Not sure if it works for C# source code, but in general, you do it like this:

Right click the class name, and then choose "Find All Implementations", or "Peek>Peek Implementations".

OR

Place the cursor on a class name, press P on Mac or CtrlP on Windows, then start typing "Implementations":

enter image description here

AlexV
  • 544
  • 9
  • 19