Now you can search code like a Googler…as long as it’s Google code

google logo

Google has given devs, and anyone else who’s interested, the ability to delve deep into its open source projects, by launching code search across the key codebases.

The vendor unwrapped Code Search this week, saying it was one of its own most popular internal tools and adding that the public tool will have the same binaries, but different flags.

As for what they do with it, the blogpost announcing the tool said Googlers “search for half-remembered functions and usages; jump through the codebase to figure out what calls the function they are viewing; and try to identify when and why a particular line of code changed.”

Initially the tool will apply to the repos of a dozen key projects, including TensorFlow, Go and Bazel. Google said it will add further projects in future. 

Advertisement

Google said that “some of the open source repositories have cross-references powered by Kythe…a Google open source project that includes tools to help understand code. “ These include the aforementioned Go, Bazel and TensorFlow. In addition, Kythe has  “drop-in support for Bazel, CMake, Maven, and Go.”

More practically, Code Search has seven different filters for searching, including case, class, content, file function, language and symbol. The language filter supports 32 different programming languages – from AppleScript to Yaml.

You also get AND and OR operators and a quartet of additional syntax options, including performing a literal search.

Or, if you’re more open to suggestions, the tool will serve “suggestions with the type of code object, the repository and the path, helping users find what they want faster.”

- Advertisement -