on-internet
← Community

clangd does not find `compile_commands.json` automatically

Stack Overflow ·

Setup I'm using clangd through neovim with nvim-lspconfig. require('lspconfig').clangd.setup { -- on_attach = keybinds.on_attach, cmd = { "clangd", "--background-index", "--suggest-missing-includes", -- "--compile-commands-dir=/home/localuser/test/build", }, filetypes = { "c", "cpp", "objc", "objcpp" }, } Problem clangd is not finding project specific includes. What it should be doing According to the documentation: (https://clangd.llvm.org/installation.html) clangd will look in the parent directories of the files you edit looking for it, and also in subdirectories named build/. For example, i

Comments

Sign in or sign up to comment and upvote.

No comments yet.