Introducing a New Way to Search Your Code and Visual Studio Features

Denizhan Yigitbas

All developers search within their code, in one way or another. Some might use code search to explore their code and understand how some components work; others might use code search to get to a very specific location they have in mind. Either way, as a developer yourself, sometimes this process of searching and finding a location might be frustrating and take you longer than you might want. Visual Studio 17.2 Preview 3 introduces a brand-new All-In-One search experience that merges the existing VS Search (Ctrl + Q) and Go To (Ctrl + T) to allow you to search both your code and Visual Studio features quicker and easier than ever, all in the same place. The All-In-One search streamlines your searching experience by providing you with a customizable UI (size, location, and dismissibility), compact search results with real-time matching as you type, and a fully keyboard friendly interface to ideally minimize your searching pain points. To try it out, download Visual Studio 17.2 Preview 3 today!

An animated GIF showing how the new All In One search experience works overall

Search for code or Visual Studio features!

The new All-In-One search provides users with a tab for code searching where you can search for symbols in your code and a tab for Visual Studio feature searching to navigate the IDE easier.

Symbol searching is a quick and easy way to navigate your loaded code. Unlike search tools like Find-in-Files, a symbol search will not search for all text matches in your code. Instead, it will look up symbol definitions. For example, you can go to the exact location where a class, method, function, variable, etc. is defined instantly. Furthermore, your search results will not be cluttered with matches in text matches such as comments, string literals, etc.

Visual Studio can sometimes get overwhelming with all of the tools and functionalities it provides. So much so that sometimes, you don’t even know where these tools exist, or you find yourself digging through lots of menus just to find where something is the IDE. The Feature Search tab in the All-In-One Search experience allows you search for Visual Studio menus, options, components, and templates. For example, I can easily launch the Solution Explorer or even search for Git functionalities all within this search experience. It’s now easier to achieve exactly what you want without the need to navigate through various menus!

An animated GIF demonstrating Visual Studio feature search in the new All In One search experience

How to use All-In-One Search

To enable the new preview feature, go to Tools > Options > Environment > Preview Features > New Visual Studio Search Experience. After restarting, you will now be able to open the All-In-One Search either with your mouse or through keyboard shortcuts

Entry Point

To open the All-In-One Search experience with your mouse, click the split button at the top of your IDE next to the “Help” menu item. Clicking the dropdown arrow will present you with two different search options: Code Search and Feature Search. Selecting either one of these options will open All-In-One Search in the respective tab. You can also simply click the “Search” button, which will open the most recently selected tab from the drop-down options.

Screenshot of Visual Studio showing the visual entry into the All In One Search

Once the window is open, you can either click between the different tabs, or you can use Ctrl + Tab or the assigned keyboard shortcuts of Ctrl + T and Ctrl + Q to switch between the code search and feature search tabs.

As we briefly explained above, the All-In-One code searching experience provides you with a symbol searching experience. In addition to symbols across your solution, you can also search for files. The three code results include:

  • Files: Search for any file type located anywhere in your loaded code in VS
  • Types: Search for definitions of classes, interfaces, enums, and types
  • Members: Search for definitions of members defined in classes and types

You can filter down your results using the files, types, and members toggle buttons in the search window:

A screenshot of Visual Studio's All-In-One search window highlighting the files, types, and members filter toggle buttons

You can access these filters without using your cursor, too. By prefixing your search query with “f:”, “t:”, or “m:”, you will be able to get the same behavior as selecting one of the filter buttons.

Customize your experience

The All-In-One search experience is a lightweight popup window in your IDE. You can customize the experience by resizing and moving the window as you desire. You can even further customize this experience by either using the search popup in an easily dismissible, type-and-go form or a sticky form.

To use the All-In-One Search in an easily dismissible, type-and-go form, make sure the “Keep search window open” checkbox is unchecked. In this experience, simply selecting a result (via keyboard enter or mouse-click), clicking outside of the window, or pressing esc will cause the window to dismiss.

To use the All-In-One Search in a sticky form, make sure the “Keep search window open” check is checked. Now, unless you actively press the “x” in the top right corner of the window, the window will remain in front of your editor even if you click away, type in the editor, or select a result. This functionality can even enable you to drag the search window onto a different monitor so you can code on one screen and search on another!

Screenshot of All In One Search highlighting how to make the window sticky and stay on top of the editor

Try it out and share your feedback!

In order to try the new All-In-One Search experience, please download Visual Studio 2022 Preview 3

We would love to get your feedback on the new search experience so please give it a try and let us know what you think! You can share any feedback via this suggestion ticket and leave comments with any thoughts!

 

20 comments

Leave a comment

  • Muhammad Miftah

    This is nice to have out of the box now, but why create yet more keyboard shortcuts and not enhance the already existing CTRL+comma UI?

    • Denizhan YigitbasMicrosoft employee

      Selam Muhammad!

      Ctrl + T and Ctrl + Comma should both be mapping into this new UI actually as they are the same keyboard shortcut actually. You should be able to try this out with Ctrl + Comma! Let me know if that works for you.

  • Peter Flannery

    Would prefer if visual studio just follows how vscode has implemented its search.
    Where everything “user project related” is located in a simple collapsible sidebar (open-editors or tabs, project explorer, search, git, tests, etc…).
    Also searching the ide and it’s command tools are separate from the user project

    • Denizhan YigitbasMicrosoft employee

      Hey Peter! Thanks for this feedback. The search provided by VSCode on the left hand side is purely a text based search where as this is more of a symbol search. VSCode has a command palette search for symbols (Ctrl + T) that is a dropdown experience in the center of the screen. I would be interested to hear what you think about that. Do you use this tool or only the search tab on the left?

      • Frederik Riboe Olsen

        While I’m not Peter, I would just like to add my two cents.

        I’m very much looking forward to giving this new search experience a try, once it’s out of preview. It looks very nice.

        I think adding something like the Command Palette from VS Code to VS would be absolutely amazing. In fact, I think it’s the single best feature that could be added to VS.
        The convenience of quickly and easily performing just about any action with the keyboard, without having to remember a thousand different keyboard shortcuts is incredible.
        Whether it’s toggling certain views/windows, performing various Git related actions, opening settings, formatting code, or doing an action provided by an extension, the Command Palette is fast, convenient and it just works.

        • Denizhan YigitbasMicrosoft employee

          Thanks for joining the conversation Frederik! The goal of this new search experience is actually exactly along these lines. You can perform all of these actions within the Feature tab! Excited to hear what you think when you give this search experience a try 🙂

  • MgSam

    I don’t understand what is wrong the current search? (CTRL + ,) is GoToEverything isn’t it? I normally use that. In the extremely rare instances I need to search for a VS feature the existing search box in the title bar is fine to select manually. We don’t need a keyboard shortcut to help us search for keyboard shortcuts. 🙂

    When what I’m searching for isn’t a symbol, I still need to use Find (CTRL + F). It sounds like this tool won’t change that, as they will remain separate tools.

    We don’t need more modal windows, we need less of them. Modals take you away from the context you’re working in. VS Code has the right idea in making everything a tab. VS used to have the right idea whereby the start page was a tab, but now its a modal (despite the huge uproar from people saying its inferior). For stuff like GoTo, the current little box in the upper right of the editor window is just the right trade off between small size and functionality.

    • Denizhan YigitbasMicrosoft employee

      Hey there! Thanks for the feedback.

      So when the blog is referring to Ctrl + T, it is actually referring to Ctrl + , as well. They both map to GoToEverything. So this experience should be replacing the Ctrl + , flow as well.

      We are also looking into making this modal a dockable tool window in the future so you can get the tabbed behavior you are mentioning. We appreciate this feedback 🙂

    • Daurin Greik

      I have no complaint with the additional layout functionality proposed (e.g. docking and moving the window around), but can those not be achieved without losing the ‘hiding in the corner’ and ‘initially little more than a text-box’ layout option? I really love knowing exactly where this transient piece of UI will be when I tap Ctrl-, and it takes up no more space than it needs to and it goes away the moment I no longer need it (and no sooner). Contrast with the new one, which remembers where I put it last, but as others have said, the context is important, and once I have more than one VS open it could either be completely removed from my code so that I have to move my head, or exactly on-top of what I’m looking at (can’t seem to set its position per VS instance either; and means I can’t have two searches open at once, which is surprisingly common when e.g. trying to debug an application that depends on a project from a different solution).

      Would including the new search functionality as a filter in the existing ‘go-to all’ box be out-of-the-question? (e.g. where we can already choose to search within a single file/for types only etc.) (Expansion of a suggestion above). The combination of simple Ctrl-F and expanded, dockable Ctrl-Shift-F is already a great experience.

      To provide some specific feedback (tested with Preview 5):
      – Alt-Tabbing away from VS with the window open makes it flash in the taskbar and closes the dialog (both new and annoying behaviours)
      – The dialog goes away if you do anything else, which is also very annoying (e.g. with the existing UI, I can scroll, click, open a different file, etc.): the existing checkbox to keep it open isn’t a complete solution, because then it _doesn’t_ go away when you actually select something, so I have to-refocus and escape it (I can escape Ctrl-, without having to refocus it))
      – The indicators on the filter buttons are very subtle in Light theme (much harder to see whether a filter is applied compared to the old UI; not tried the other themes)
      – Selecting a filter by pressing the button steals the focus from the search box (which is really annoying)
      – Whether the UI gets in the way or not (e.g. if moved out of the way), the new dialog doesn’t allow you to preview items by selecting them (e.g. with cursor keys or single-click); the old UI lets you step through the result without closing the window (the ‘use tab preview’ option)
      – Obviously, various filter options are missing, but I’m assuming those are just TODO
      – New filter buttons probably improve discoverability for new users, though the `?`, tool-tips, and status indications do a good job of this already
      – As above, issues with VS instances fighting over where the window should appear; can’t characterise these precisely, but not being able to have two search window open is a real irritation

      If I could chose how this went, I’d suggest: use Ctrl-T as the default for a new expanded UI (with missing functionality/fixes (docking, preview, full set of filters, etc.) with its better discoverability and the ability to switch between search modes (e.g. a text-search could be included as a tab)), and leave Cltr-, as defaulting for the existing hiding-in-the-corner UI. (I don’t much care about Ctrl-Q: I don’t use it hundreds of times a day like I do Ctrl-, so I won’t comment on it). Note that the current and described goal behaviour is not far removed from what we have in JetBrains products at the moment, so I’m already somewhat used to their differences (needless to say I prefer searching in VS, though the (additional) full-text search functionality is nice, and I assume is a candidate for another tab in this new UI component, though hopefully not at the expense of the existing Ctrl-F and Ctrl-Shift-F functionality).

  • Chuck Ryan

    I am beginning to wonder if the VS team works on anything other than adding new searches.

    Personally I consider having to resort to searching for features as a failure of the UI design and the constant use of modal dialogs, that you often cannot copy text to the clipboard from, as poor/lazy coding.

  • Stelios Adamantidis

    Ok here comes the tough question: when do you plan to add incremental search across all files with preview like most modern IDEs do? VS 2030? 😁

    Oh well, until then, I will open VS only for the good old Winforms designer…

      • Stelios Adamantidis

        Hello Denizhan, sure by all means!

        What I mean is the “Ctrl + Shift + F” dialog shows the results in real time, as you type. You don’t have to press any “Find” extra button. Unless you want to of course. But most of the times I find what I am looking for in the first 10 lines of the results. I only need to click on “Open in Find Window” when I want to see the results grouped per file, project etc.

        As an example there is FastFind22 VS plugin and Rider.

        Hope that helps. I’m at your disposal if you need any more details or clarification.

      • Stelios Adamantidis

        For the record (and for the others to see) I replied and for some reason my comment is still awaiting moderation. It’s fine for me as long as you read my feedback and understand what I mean even if you don’t decide to publish it.

        Cheers.

  • Partha Mandayam

    PLease correct the typo
    click the split button at the top of your IDE next to the “Help” menu item.
    It should be Search button not split button. There is no split button