Code Search is now Java friendly
In addition to C#, C, C++, and Visual Basic code, you can now do semantic searches across Java code. Adding to our Java feature set and capabilities, we recently enabled contextual search for Java files in the Code Search extension for Visual Studio Team Services and Team Foundation Server starting with TFS “15”. You can apply code type filters to search for specific kinds of Java code such as definitions, references, functions, comments, strings, namespaces, and more.
Semantic search for Java enables Code Search to provide more relevant search results. For instance, a file with a match in definition is ranked above a file with a match as method reference. Similarly, matches in comments are ranked lower than references and so on.
You can use Code Search to narrow down your results to exact code type matches. Navigate quickly to a method definition to understand its implementation simply by applying the definition filter, or scope the search to references in order to view calls and maximize code reuse. You can filter your search to basetype instances to locate a list of derived classes or scope a search to interface instances.
As you type in the search box, select functions and keywords from the drop-down list to quickly create your query. Use the Show more link to display all the available functions and keywords. Mix and match the functions as required.
Alternatively, you can select one or a combination of filters from the list in the left column.
You can type the functions and parameters directly into the search box. The following table shows the full list of functions for selecting specific types or members in your Java code.
To find code where “term” appears as a
class definition or declaration
Code Search is available as a free extension on Visual Studio Team Services Marketplace and Team Foundation Server starting with TFS “15”. Click the install button on the extension description page and follow instructions to enable Code Search for your account. For installation on TFS see Administer Search.
You can learn more about the Java integration within Visual Studio Team Services at java.visualstudio.com.