'How to use clangd to find headers of gcc on MacOS

My system is macOS 12.3 21E230 arm64 and I have installed gcc and llvm from homebrew. I use Neovim as editor and use nvim-lsp via clangd to complete my code, and it works well with clang. Now I want to use clangd to find headers of gcc and compelete them in my code. I have tried to find answer from https://clangd.llvm.org/, but I haven't find any way to solve this problem.

I tried setting --query-driver, -include-dir, -isysroot, etc.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source