Microsoft has introduced a new Visual Studio extension – Bing Developer Assistant for Visual Studio (currently tagged as Beta). This extension allows you, the developer, to locate millions of code snippets and sample projects from within the Visual Studio IDE. Essentially, this extension combines the features of two previous extensions: Bing Code Search and Sample Browser.
Code Snippets in IntelliSense
The Bing Developer Assistant extension provides some nice additions to the Visual Studio IntelliSense experience. Most notably, it can provide you with a code snippet that is relevant to the API you are actively coding against. For example, in the screenshot below, I am looking at the IntelliSense for the Send method of the SmtpClient class:
If you happen to be on an API that doesn’t have any code samples, you’ll see something like the following:
The cool part is that you can opt to share some of your own code samples if nothing is found. Nice!
Taking the code snippets one step further is the Sample Browser. This feature allows you to search for multiple code examples at once as well as for sample projects that can be downloaded and opened in Visual Studio.
Playing off the above examples, let’s say you want to find some examples of how to send e-mail using C#. In the Bing-powered Code Samples toolbar, enter “send mail” and press Enter. A new tab will be opened looking something like this:
One final feature of the Bing Developer Assistant is the ability to perform your searches while offline. You can configure the folders that are indexed via the Tools->Options->Bing Developer Assistant->Code Snippets options. For example:
Caveats & Observations
- The new IntelliSense features are currently available for C# only – other languages will likely be supported in the future.
- The new IntelliSense features do not work in conjunction with ReSharper’s IntelliSense features — you must choose one or the other!
- I’ve noticed some “quirks” when searching for sample projects – e.g. sometimes sample projects will be listed in the search results but clicking on them to view the details does not work (these tend to be at the end of the list).
- The Code Samples search box is included in the “Standard” toolbar – i.e. it cannot be turned off or moved to another area of the IDE without dragging along the entire “Standard” toolbar. A comment on the extensions web site implied that the search box will have its own toolbar at some point down the road.
All that said, I can definitely see the potential usefulness of this add-in and plan to keep it turned on for now to see if it truly makes a difference. Now if we can only figure out how to tie the searches into Bing Rewards