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

argument

arg: term

base type

basetype: term

class definition or declaration

class: term

class declaration

classdecl: term

class definition

classdef: term

comment

comment: term

constructor

ctor: term

declaration

decl: term

definition

def: term

enumerator

enum: term

field

field: term

function

func: term

function declaration

funcdecl: term

function definition

funcdef: term

global

global: term

header

header: term

interface

interface: term

method

method: term

method declaration

methoddecl: term

method definition

methoddef: term

namespace

namespace: term

reference

ref: term

string literal

strlit: term

type

type: term

typedef

typedef: term

union

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 java.visualstudio.com.

Thanks, Search team

0 comments

Discussion is closed.

Feedback usabilla icon