I am working on an IDE and I just discovered clangd. Sounds interesting. What do I need to do to integrate clangd with my IDE? Is there any documentation/examples/…?
Guessing from its name, I assume clangd is a daemon running in the background. How do I communicate with it?
Clangd is a language server. There’s a good overview at Overview and a detailed protocol spec that clangd implements much of.
You integrate with it by spawning it as a subprocess and speaking LSP via stdin/stdout. (There’s also a ClangdServer C++ API, but it has no stability guarantees, and no docs beyond what you’ll find in the code)
Is there any information about specific extension of clangd ? Like the protocol specification for passing compiler arguments via the LSP instead of compile_commands.json ?
Extensions are here: Protocol extensions
Possible it’s not complete, though!