[cfe-dev] Cquery vs Clangd

Marc-André Laperle via cfe-dev cfe-dev at lists.llvm.org
Thu Mar 1 10:50:23 PST 2018


Hi Manuel,

A few relies below.

On Thu, 2018-03-01 at 13:24 +0000, Manuel Klimek wrote:
- cquery is based on libclang, while clangd directly works with the AST and provides a non-LSP C++ interface to be integrated as service in larger environments - this lets clagnd work in places where libclang is hard to integrate

Would that C++ interface be usable for out-of-tree projects? I guess one would simply link to libclangDaemon?

- clangd wants to integrate with other folks in the community on indexing interfaces and mechanisms that provide a platform for tools to work on; while there is also some prototyping, a lot of work goes into designing the right system
- clangd puts scale and performance first; for very very large code bases (significantly larger than chromium), this is a precondition, and (together with the previous item) why we don't have a global index yet

I think cquery puts those two first but it sounds like you have even more agressive requirements.

- clangd work currently focuses on making code completion really good, so quite a bit of work has gone into how to split the preamble and making completion results better (which also benefits cquery \o/)

The hope is that clangd at some point will catch up with cquery, but as those things go, in the end they will probably have slightly different trade-offs, so some folks will use one while others use the other. In principle that's the nice thing about the LSP; competition is now possible :)

Yeah, clients can adopt one of the other pretty easily (well maybe without extension support). I think it's good to understand the different trade-offs and compare the different goals so that potential contributors can decide where to focus their work.


For everyone interested, come join the talk on clangd at the Euro LLVM in Bristol; that talk will include a more detailed comparison between the two approaches.

That sounds very good. I'll be there!

Thank you for your time,
Marc-André
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20180301/2dae061b/attachment.html>


More information about the cfe-dev mailing list