Skip to content

IDE integration — real IntelliSense from your actual build ​

CLAP doesn't reinvent editor support. It emits a standard compile_commands.json — the file every clangd-based tooling understands — with the exact flags your build uses, including vendored dependency include paths. Because the compiler underneath is real clang (zig cc), the flags are clang-native, so clangd parses your project with essentially zero fidelity loss.

Setup ​

bash
clap build --compile-commands

That writes compile_commands.json at your project root. Re-run it when you add sources or dependencies — or just leave the flag in your muscle memory; it costs nothing.

VS Code ​

  1. Install the clangd extension (llvm-vs-code-extensions.vscode-clangd).
  2. If the Microsoft C/C++ extension is installed, either disable its IntelliSense (C_Cpp.intelliSenseEngine: disabled) or uninstall it — two language servers fighting over the same files is worse than either alone.
  3. clangd finds compile_commands.json at the project root automatically. Errors, go-to-definition, rename, and hover now reflect your real build — vendored dependencies included.

The CLAP VS Code extension handles building/testing; clangd handles editing. They're complementary, not overlapping.

Neovim / vim ​

With nvim-lspconfig:

lua
require('lspconfig').clangd.setup({})

clangd walks up from your source files and picks up the root compile_commands.json on its own. Nothing CLAP-specific to configure.

CLion / other CMake IDEs ​

If your project is a CMake project driven through clap cmake, the IDE already understands it natively — use the IDE's own CMake integration. For direct-sources projects, generate the compilation database as above; CLion can index a compile_commands.json project via "Open as compilation database project".

Why not a custom language server? ​

Because clangd is better than anything we'd write, already installed on millions of machines, and the compilation database is the honest interface: your editor sees exactly what the compiler sees. If intellisense disagrees with the build, the build is what ships — but with this setup they can't disagree, because both read the same flags.