From 30e0e768c4b4354ced455a85d78867f3af6ce38c Mon Sep 17 00:00:00 2001 From: Oscar Wallberg Date: Tue, 8 Oct 2024 19:39:01 +0200 Subject: [PATCH] fix(clangd): use compilation database for all files opened --- lua/lsp/config/clangd.lua | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lua/lsp/config/clangd.lua b/lua/lsp/config/clangd.lua index 1d44daf..144fcf5 100644 --- a/lua/lsp/config/clangd.lua +++ b/lua/lsp/config/clangd.lua @@ -22,6 +22,10 @@ return { "clangd", "--clang-tidy", "--enable-config", + + -- Fix for errors in files outside of project + -- https://clangd.llvm.org/faq#how-do-i-fix-errors-i-get-when-opening-headers-outside-of-my-project-directory + "--compile-commands-dir=build", }, single_file_support = true, },