Link Search Menu Expand Document


Bzl implements a codesearch feature that allows you to define codesearch indexes based on bazel queries, and search them using simple or regular expressions.

Creating an Index

To create an index, provide the bazel query as the positional arguments and give it a name:

$ bzl code index create --name=all 'deps(//absl/...)'

You can search the index via the command line:

bzl code search --index=all '<sstream>'
absl/random/internal/ #include <sstream>
embedded_tools/src/main/cpp/util/ #include <sstream>
absl/random/ #include <sstream>
/private/var/tmp/_bazel_i868039/9a22f63cfea7c4a7c8ae084f584bea24/external/com_github_google_benchmark/src/ #include <sstream>
embedded_tools/src/main/cpp/util/ #include <sstream>
embedded_tools/src/main/native/windows/ #include <sstream>
embedded_tools/src/tools/launcher/util/ #include <sstream>
absl/strings/internal/str_format/ #include <sstream>

Or via the UI:

Use the Repository > Search Code menu option (o k) to navigate to the codesearch widget:

Copyright © 2021 Stack.Build.