This example is intended to get irony-mode working on a bazel project.
The steps to reproduce are simple:
-
Install irony-mode (and its sub-packages:
company-ironyandflycheck-irony). -
Install bazel.
-
Compile this project so that it produces a
compile_commands.jsonfile, using these commands:$ bazel build --experimental_action_listener=//tools/actions:generate_compile_commands_listener //... $ python3 tools/actions/generate_compile_commands_json.py
-
Open
hello_irony/main.ccand verify that irony mode successfully readcompile_commands.json(viaM-x irony-cdb-menu) but that the auto-complete features do not work.
Credit to this gist
for how to generate a compile_commands.json file from bazel.
Because of Python 2/3 issues I regenerated the protoc like this:
protoc extra_actions_base.proto --python_out=.
Some details about the compilation database generation for irony-mode: