I am using neovim with coc.nvim and coc-clangd, I want the code completion to stop recommending functions that are not in the header files that I have included.screenshot
I have not been able to find anything relevant to my issue, when I google it I only find how to stop auto including files
Creating a
.clangdfile with the following will help:(See https://clangd.llvm.org/config.html#standardlibrary for more details.)
This will prevent clangd from indexing all standard library headers upfront.
Note, however, that clangd will still suggest functions from files that are included anywhere in your project (so, if another file in your project includes
wchar.h, you will still get completions fromwchar.h).There isn't currently a mode to only suggest functions from headers included in the current file. You're welcome to file a feature request about that at https://github.com/clangd/clangd/issues.