Recently Microsoft put as Generally Available a very interesting extension in the Visual Studio Marketplace, the Code Search extension. Install it on your VSTS is as simple as go to the previous link and click install, then select the Visual Studio Team Services account in which you want to install the extension, of course you need to be an Administrator to install it.
To install on Team Foundation Server “15”, is just as simple as install it during the installation phase of TFS.
But, what enables this extension? Once you install it, on your team projects you will have, in the menu bar, a search box in which you can select to search code:
When you select code, you will be presented some of the main options to search for code.
But there are even more options you can check in the help page.
The interesting thing of this Code Search extension, is it not only look for text inside the code files, that would be easy, it searches across all projects or just the ones you want.
But it also allows you to put filters like for example look only for classes named like the term you are looking for, or comments, references and a lot of more, I’m really impressed on how rich it is. Of course you can refine your queries with AND, OR, NOT terms.
Also it integrates with history, so when you find what you are looking for, you can see its history, compare with previous versions, and you can even see annotations within the code.
Just as a conclusion a pretty nice extension you can start installing and using on your VSTS to search for code, but far beyond the usual look in files functionality.
As technology it uses in the behind, if you look here you will see it uses:
- Oracle Server JRE, yes for TFS you will need to install it on the server, but you can install Code Search on a separate server. Of course for VSTS you don’t need to care about this.
- Roslyn (hype increasing on this one)
And about languages it supports, currently it supports C#, C++, C, VB.NET, and recently they added support for Java also, and it is ok to think they will be updating the list of languages.
So go ahead, install it and try it, you can find more options and documentation here.