ardalis

Steve Smith, software craftsman

Connect with me:

  • Blog
  • Training
  • Mentoring
  • Dev Tips
  • Architecture eBook
  • Tools Used
  • About
Finding Things in Visual Studio 2017

Steve Smith 14 Mar 2018 Leave a Comment

Finding Things in Visual Studio 2017

I’m a proponent of small, single-purpose files for most things in software applications. This helps follow certain SOLID principles, like Single Responsibility and Interface Segregation. It also means my applications tend to have a large number of files. This isn’t a problem unless you have a hard time working with lots of files. Fortunately, there are tools that make it easier to work with many files. The first one is the lowly directory/folder. Be comfortable using folders to organize your files, ideally around the feature they provide to the user, not the kind of file they happen to be. This will help you deliver software as a series of vertical slices and makes it easier to work within a single folder when working on a feature. The second tool, though, is a multi-find tool in Visual Studio 2017 that’s accessed by default using Ctrl+t. It’s called “Go to All”.

Find All The Things with Go To All!

The Go to All dialog in Visual Studio is triggered by default with the Ctrl+t shortcut. When it comes up, it defaults to searching in a wide variety of places (hence the ‘All’ moniker), but you can easily narrow it down with a keyboard shortcut.

vs-go-to-all-window

If you don’t have anything selected when you trigger Go to All, you’ll see the default behavior shown above. However, if you have a term selected, Go to All will appear pre-populated with the term and will immediately display the results for it:

vs-go-to-all-term

What’s even cooler, though, is the UI for filtering down the selection. See, sometimes you know you’re looking for a file, while other times you want a type. And still others you want a member. You can trigger any of these filters and more using the icons at the top of the dialog, but you can also specify these filters using a single character prefix. Type ‘?’ to see the full list:

vs-go-to-all-help

As you can see from the image above, you can prefix your search with ‘f’ for Files, ‘m’ for Members, or ‘t’ for Types. You can also jump to a specific line number by prefixing it with ‘:’ or search symbols using the ‘#’ filter. In the past, I’ve made heavy use of Resharper’s Ctrl-n and Ctrl-shift-n shortcuts to go to files and types, or sometimes the Solution Explorer Ctrl+; search option. Now I only need to use one Ctrl+(something) shortcut for all of these things.

What about long names?

Naming things is tough. Longer names are more descriptive and clear in many cases, but can be a hassle to type out.  Fortunately, search tools like Go to All support Pascal-Case searching. What this means is that instead of having to type out all or most of a long name like ToDoItemCompletedEvent you can instead just type some or all of the capitalized letters, like TDIC:

vs-go-to-all-pascal-search

Preview Result

Another nice feature (that you can turn off if you don’t like it) is that you can see the result in a preview tab. Visual Studio preview tabs open in response to single-clicking documents in Solution Explorer, and also are the default experience for Go to All. As you adjust your filter or change which result is selected (using mouse or arrow keys), the selected result will open in a preview tab so you can immediately see it. This can be very useful as well, and often is sufficient to be able to see what you’re looking for.

vs-go-to-all-preview-tab

Summary

Obviously the ability to search for things has been around for a long time and hardly seems worth writing about. However, the integrated navigation experience of the Go to All dialog in Visual Studio is the kind of hidden gem that I think many developers are both unaware of and would find helpful on a regular basis. Let me know if I missed anything important and if you feel like this feature is one you’ll use (or not).

Images shown here are from my Clean Architecture solution starter kit for ASP.NET Core apps.

Filed Under: Uncategorized Tagged With: tip, visual studio

About Steve Smith

Steve is an experienced software architect and trainer, focusing currently on ASP.NET Core and Domain-Driven Design. His courses on Pluralsight help developers write better, more maintainable code. He is available for application assessments and team mentoring engagements.

Online Training

  • ASP.NET Core Quick Start
  • Domain-Driven Design Fundamentals
  • Refactoring Fundamentals
  • Kanban Fundamentals
  • SOLID Principles of OO Design
  • Pair Programming
  • Pluralsight FREE Trial

About Me

Steve is an experienced software architect and trainer focused on improving team skills with DDD and ASP.NET Core. His courses on Pluralsight and DevIQ help developers write better, more maintainable code. He is available for application assessments and team mentoring engagements.

Sign up to receive a free developer tip from Steve in your inbox every Wednesday.

Free Architecture eBook

Architecting Modern Web Applications with ASP.NET Core and Microsoft Azure Download PDF

Recent Articles

  • Momentum Dev Conference and Design Patterns
  • WeeklyDevTips Podcast Checklist
  • Positive Reinforcement in Code Reviews
  • Finding Things in Visual Studio 2017
  • How to Modify Visual Studio 2017 or Install Preview Versions

Popular Articles

  • Force Nuget to Reinstall Packages without Updating 1,083 views
  • How to add a Nuget Package Using dotnet add 884 views
  • How to find all objects in a SQL Server Schema 639 views
  • Architecture eBook 628 views
  • Why Delete Old Git Branches? 519 views

Recent Tweets by @ardalis

Tweets by @ardalis

Popular Articles

  • Architecture eBook 524 views
  • How to add a Nuget Package Using dotnet add 225 views
  • Force Nuget to Reinstall Packages without Updating 174 views
  • Using MediatR in ASPNET Core Apps 171 views
  • Dev Tips Weekly 164 views

More Resources

  • Contact Us
  • Interviews
  • Assessments
  • Mentoring
  • Training
  • Dev Tips Weekly
  • Archive

Dev Tips

Get a free developer tip in your inbox every Wednesday.

Become a better developer

Copyright © 2018 · Streamline Pro Theme on Genesis Framework · WordPress · Log in