Skip to content

Commit 71d3d0a

Browse files
committed
--file docs
1 parent 8c03693 commit 71d3d0a

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

refresh.template.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,9 @@
33
44
Interface (after template expansion):
55
- `bazel run` to regenerate compile_commands.json, so autocomplete (and any other clang tooling!) reflect the latest Bazel build files.
6-
- No arguments are needed; info from the rule baked into the template expansion.
6+
- No arguments are needed; info from the rule is baked into the template expansion.
77
- Any arguments passed are interpreted as arguments needed for the builds being analyzed.
8+
- The one exception is --file=<file_target>, which can be used to update commands for just one file. This is intended for programmatic use from editor plugins.
89
- Requires being run under Bazel so we can access the workspace root environment variable.
910
- Output: a compile_commands.json in the workspace root that clang tooling (or you!) can look at to figure out how files are being compiled by Bazel
1011
- Crucially, this output is de-Bazeled; The result is a command that could be run from the workspace root directly, with no Bazel-specific requirements, environment variables, etc.

refresh_compile_commands.bzl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,8 @@ refresh_compile_commands(
4949
# exclude_headers = "external",
5050
# Still not fast enough?
5151
# Make sure you're specifying just the targets you care about by setting `targets`, above.
52+
# That's still not enough; I'm working on a huge codebase!
53+
# This tool supports a fast, incremental mode that can be used to add/update commands as individual files are opened. If you'd be willing to collaborate on writing a simple editor plugin invokes this editor on open, please write in! (And see --file flag in refresh.template.py)
5254
```
5355
"""
5456

0 commit comments

Comments
 (0)