Introduction
"Bing Code Search for C#.NET" extension searches snippets from community sites (like MSDN, StackOverflow, Dotnetperls and CSharp411) and allows us to insert code in editor with out leaving Visual Studio instance. With this feature, its makes developers job easy and improves productivity.
Where to Download:
From the page > Click on Download button > downloads CodeSnippets.vsix file to local machine > run vsix file.
Alternative Download:
We can download and install extension from Visual Studio > Menu > Tools > Extensions and Updates > Online > Search "Bing Code Search"
Once extension is installed, You must restart Microsoft Visual Studio in order for the changes to take effect and your ready to use the features.
How to Use:
Open visual studio C# code file, press ctrl + tab button to get intellisense. From the intellisense we can see "How do I..." menu item.
Double click on "How do I ..." and it opens "Bing Code Search" window like peek definition.
Bing Code Search window contains
- Type query here -Text to search
- Search Image Button - To Search for the code ( or you can use enter button when focus is on 'Type query here' textbox)
- Accept Button - To insert code to your visual studio file (Enabled once you have one or more search results)
- < 0 / 0 > - current search page / total search count pages
Here i tried to search for "
string remove last character". (One more cool feature is it has auto search text suggestion.). It tries to find all relevant search results from different community sites.
From the search results you can find
- Accept Button - Inserts current search code to editor (alternatively you can use enter button))
- 3 / 10 - Currently showing 3rd search result page out of 10 results
- Title : Page title from search result page
- Author : Who is the author for the code. click on Author link takes to author publie profile page.
- Source : Search source (can be http://msdn.microsoft.com/, http://stackoverflow.com/, http://www.dotnetperls.com/, http://www.CSharp411.com). If you click on source URL, it will take you to original post.
- Rating: Rating of code
KeyBoard ShortCut:
"ALT-A" is the shortcut to launch bing code search. If you want to change short cut keys, do it from Tools->Options->Environment->Keyboard > Type "Tools.LaunchSnippetSearch"
Can I use with .vb File
It works only for C#.NET code files. If you try to search for VB.NET file it shows "No code snippets found"