/bazel-example-irony-mode

Sandbox for trying to get irony-mode to work in a bazel project

Primary LanguageC++

Introduction

This example is intended to get irony-mode working on a bazel project.

The steps to reproduce are simple:

  1. Install irony-mode (and its sub-packages: company-irony and flycheck-irony).

  2. Install bazel.

  3. Compile this project so that it produces a compile_commands.json file, using these commands:

    $ bazel build --experimental_action_listener=//tools/actions:generate_compile_commands_listener //...
    $ python3 tools/actions/generate_compile_commands_json.py
  4. Open hello_irony/main.cc and verify that irony mode successfully read compile_commands.json (via M-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.

Sarcasm notes

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: