README.md

Irony-Mode

irony-mode is an Emacs minor-mode that aims at improving the editing
experience for the C, C++ and Objective-C languages. It works by using a
combination of an Emacs package and a C++ program (irony-server) that uses
libclang.

Elisp dependencies

Optional. May be used to provide post-completion expansion of function arguments

Irony-Server prerequisites

irony-server provides the libclang interface to irony-mode.
It uses a simple protocol based on S-expression. This server, written in C++ and
requires the following packages to be installed on your system:

w32-pipe-read-delay default value of 50 should be changed. This should not
cause any issue on today's version of Windows. The default value of 50 may
be lowered in mainline Emacs in future versions, until then please add the
following to your irony-mode configuration:

(setq w32-pipe-read-delay 0)

Usage

On the first run, irony-mode will ask you to build and install irony-server.
To do so, type M-x irony-install-server RET.

To tune irony-mode, use customize:

M-x customize-group RET irony RET

In order to provide context sensitive and accurate information, irony-mode
needs to know about the compiler flags used to parse the current buffer. The
best way to achieve this is to use a
Compilation Database.

Compilation Database

In order to work correctly, irony-mode needs to know the compile flags.
irony-cdb aims to provide as automatic as possible compile flags discovery,
with minimal user input.

Please refer to irony-cdb-autosetup-compile-options and
irony-cdb-compilation-databases.

Right now irony-cdb supports the following compilation databases:

JSON Compilation Database - A JSON formatted file
generated by various build tools. The file is named compile_commands.json,
it lists the compile options associated to each file in the project.

CMake >= 2.8.5 will generate a compilation database in the
build directory hen issuing the following command
cmake -DCMAKE_EXPORT_COMPILE_COMMANDS=ON <...>.

ninja >= 1.2 will generate a JSON Compilation Database when
using the compdb tool.

Bear generates a JSON Compilation Database file by "monitoring"
the build of a project. The typical usage for a make-based project will be
bear -- make -B.

FAQ

It's slow, why?

A bug in old version of Clang (at least '3.1-8') caused the completion to fail
on the standard library types. To eliminate this bug an optimisation has been
disabled in the parsing of a translation unit. This result in a slower parsing.

This only affect old versions of Clang (< 3.2), it is suggested to update your
libclang installation if you want to take advantage of the optimizations.

libclang.so: cannot open shared object file...

Compiling irony-server succeed but you have the following message when you try
to run the irony-server executable:

When libclang is installed in a non-standard location (one that is missing
from the path list of the dynamic loader, see ld.so.conf) you can tell CMake
to use the rpath when installing the target irony-server. To
enable rpath in CMake use the following command: