ReSharper Tip: Go to File by Name

This is one of my favorite little ReSharper features that took me a while to discover and fully appreciate.

Let's say you're working in a huge application with a deeply nested directory structure.  You're chugging along, editing some arbitrary file somewhere.  Ok, now you're ready to jump to some other file in your application and read some code or make some changes there.  The things is, you only kind of remember the name of the file, you don't really remember which folder it's in, and you really don't feel like digging through the whole folder structure of your application to find out where the file is hiding.

In comes ReSharper's "Go to File by Name" feature to save the day.

Let's say that file you're looking for is a master page, and you think it's name starts with "Guest".

Hit Ctrl+Shift+N and start typing "guest".  You'll get a list of all the files in your application that start with "guest".  Now just select the file you're after, and bam!  There you are.

screen1

Let's say you know that the file you need is a master page, but you don't remember anything else.

Hit Ctrl+Shift+N and start typing ".master".  Unfortunately, since the file name obviously doesn't start with ".master", ReSharper can't match any files, and you see that the text turns red.

screen2

But, thanks to a little feature I discovered recently, you can type an asterisk ('*'), and ReSharper will treat it as a wildcard.

So, try your query again, but this time type "*.master".  Now you'll see a list of all the master page files in your application, and you can easily locate the file you're after.

screen3

Obviously, this is only a very simple example.  I'll leave it as an exercise to the reader to imagine all the various ways that this could help one to locate arbitrary files in a large application.

Enjoy! (And get ReSharper if you don't already have it!)

0 comments :