Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add instructions on how to setup clangd and clang-tidy #570

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,14 @@ This library was inspired from experience building and using the [libprocess](ht
### Bazel
For an example of how to depend on eventuals via Bazel in your own project you'll need to copy the lines selected in [WORKSPACE.bazel](https://github.com/3rdparty/eventuals-tutorial/blob/main/WORKSPACE.bazel#L3-L31) from our [eventuals-tutorial](https://github.com/3rdparty/eventuals-tutorial) repository.

### clangd and clang-tidy integration
The default C++ engines provided by many code editors (e.g. `IntelliSense` in VS Code) were found inconsistent and quite painful to use. Since this project relies on `Clang` toolchain, we can use the power of `clangd` and `clang-tidy` checks to provide developers with smooth coding experience and preemptive warnings:

1. Build the library using Bazel: `bazel build eventuals` (or `bazel build ...` if you prefer to build tests as well). This step is a must to ensure that all dependecies are downloaded and built beforehand.
2. Run the compiler command generator rule: `bazel build refresh_cc`. This command will generate a file with all compiler commands issued by `Bazel`.
3. Follow the [clangd's Getting started guide](https://clangd.llvm.org/installation) to install the necessary plugins into your favourite code editor.
4. You're ready to roll!

### Eventual's theory

Most of the time you'll use higher-level ***combinators*** for composing eventuals together. This guide will start with more basic ones and work our way up to creating your own eventuals.
Expand Down