Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ReSharper: find derived types constructor usages points

Tags:

resharper

I have some base class ControlBase and many derived classes which also have derived classes... ControlBase and derived classes have parameterless constructor. How can I easily find all derived classes constructor invocation points? ReSharper find usages on ControlBase constructor shows only usages of this base class constructor but not derived classes constructors.

Thanks.

like image 462
Roman Avatar asked Jun 01 '10 07:06

Roman


1 Answers

You can achieve this by using the structural search feature in Resharper 5.

Go to Resharper/Find/Search with Pattern in the menu. Then enter the following pattern in the textbox on the left:

new $type$($args$)

The words enclosed by the Dollar signs are placeholders which have to be specified. You can do this by clicking on "Add Placeholder".

In your example you need a Type placeholder (name=type, Type=ControlBase, check "Or derived type") and an Argument placeholder (name=args).

like image 130
Markus Dulghier Avatar answered Oct 20 '22 16:10

Markus Dulghier