diff options
| author | Sam Estep <sam@samestep.com> | 2025-07-28 17:11:11 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-07-28 21:11:11 +0000 |
| commit | a2d93ae0122aff62866e9266e5e51d4615a00783 (patch) | |
| tree | 623dbfc90be3142359d044725a347ee7bb4bb880 /flake.nix | |
| parent | 5f8475bee2589b8e851c856135cf10758e859e72 (diff) | |
Disable automatic `#include` insertion for clangd (#7951)
Diffstat (limited to 'flake.nix')
| -rw-r--r-- | flake.nix | 21 |
1 files changed, 17 insertions, 4 deletions
@@ -21,10 +21,23 @@ # the latter brings in GCC by default on Linux. devShell = pkgs.mkShellNoCC { buildInputs = [ - # Must put `clang-tools` before `clang` for clangd to work properly. - # We use `llvmPackages_17.clang-tools` instead of just `clang-tools` - # to match the `clang-format` version used in CI. - pkgs.llvmPackages_17.clang-tools + # We must list clangd before the `clang` package to make sure it + # comes earlier on the `PATH`, and we must get it from the + # `clang-tools` package so that it is wrapped properly. + (pkgs.linkFarm "clangd-21" [ + { + name = "bin/clangd"; + # New enough to support `HeaderInsertion: Never` in `.clangd`. + path = "${pkgs.llvmPackages_21.clang-tools}/bin/clangd"; + } + ]) + (pkgs.linkFarm "clang-format-17" [ + { + name = "bin/clang-format"; + # Match the clang-format version used in CI. + path = "${pkgs.llvmPackages_17.clang-tools}/bin/clang-format"; + } + ]) pkgs.clang pkgs.cmake |
