From ee429aea17df613758bbee451f96ecf80e2cef9e Mon Sep 17 00:00:00 2001 From: Greg Miller <9447643+devjgm@users.noreply.github.com> Date: Fri, 25 Feb 2022 21:13:50 -0500 Subject: [PATCH] chore: gitignore ephemeral files that clangd uses This PR tells git to ignore ephemeral files that are created when developers use clangd. clangd needs a `compile_commands.json` file at the root of the repo (or in a `build/` directory) to tell it how to compile each file. CMake can generate this file with something like the following: ```console $ cmake -Scmake -B.build \ -DCMAKE_EXPORT_COMPILE_COMMANDS=ON \ -Dprotobuf_BUILD_TESTS=OFF $ ln -sf .build/compile_commands.json . ``` Then clangd will compile and index files into the `.cache` directory. --- .gitignore | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.gitignore b/.gitignore index 1040236af1..4fe3edde37 100644 --- a/.gitignore +++ b/.gitignore @@ -222,3 +222,7 @@ _build/ # BenchmarkDotNet BenchmarkDotNet.Artifacts/ + +# Clangd uses these common ephemeral files +.cache +compile_commands.json