Code Search is now Java friendly

Shruti Poddar [MSFT]

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.

Code Search - Ranking Results

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.

Code Search - Filter Helper Dropdown

Alternatively, you can select one or a combination of filters from the list in the left column.

Code Search - Code Type Filters

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

Search for


arg: term

base type

basetype: term

class definition or declaration

class: term

class declaration

classdecl: term

class definition

classdef: term


comment: term


ctor: term


decl: term


def: term


enum: term


field: term


func: term

function declaration

funcdecl: term

function definition

funcdef: term


global: term


header: term


interface: term


method: term

method declaration

methoddecl: term

method definition

methoddef: term


namespace: term


ref: term

string literal

strlit: term


type: term


typedef: term


union: term

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

Thanks, Search team


Discussion is closed.

Feedback usabilla icon